Many Covers From A Long List For Many FLAC Files?

Main discussion forum
Post Reply
rawac
Newbie
Newbie
Posts: 2
Joined: Mon Jan 21, 2013 10:33 am

Many Covers From A Long List For Many FLAC Files?

Post by rawac »

Hello together

Short introduction, because i'm new in this forum. My name is Ralf, i'm from Germany and a jazz fan. My collection grew over 30 years, and now i'm converting it to FLAC. The text fields of the files are already tagged. Still missing: the cover art.

Because i started my own database about my collection a long time ago, all covers are already scanned. From my database i can get a list with every filename of the FLAC audio file, and the corresponding JPEG file. A sample:

Code: Select all

...
"L:\Music\FLAC\K\David Krakauer\Pruflas Book of Angels Vol18\01•Ebuhuel.flac" "D:\Daten\CDData\Cover\Krakauer_David_Pruflas_Book_Angels_18.jpg"
"L:\Music\FLAC\K\David Krakauer\Pruflas Book of Angels Vol18\02•Kasbeel.flac" "D:\Daten\CDData\Cover\Krakauer_David_Pruflas_Book_Angels_18.jpg"
"L:\Music\FLAC\K\David Krakauer\Pruflas Book of Angels Vol18\03•Vual.flac" "D:\Daten\CDData\Cover\Krakauer_David_Pruflas_Book_Angels_18.jpg"
...
"L:\Music\FLAC\K\David Krakauer\Pruflas Book of Angels Vol18\08•Monadel.flac" "D:\Daten\CDData\Cover\Krakauer_David_Pruflas_Book_Angels_18.jpg"
"L:\Music\FLAC\Z\John Zorn\Nosferatu\15•Renfield.flac" "D:\Daten\CDData\Cover\Zorn_John_Nosferatu.jpg"
"L:\Music\FLAC\Z\John Zorn\Nosferatu\01•Desolate Landscape.flac" "D:\Daten\CDData\Cover\Zorn_John_Nosferatu.jpg"
"L:\Music\FLAC\Z\John Zorn\Nosferatu\02•Mina.flac" "D:\Daten\CDData\Cover\Zorn_John_Nosferatu.jpg"
...
"L:\Music\FLAC\Z\John Zorn\Nosferatu\14•Vampires at Large.flac" "D:\Daten\CDData\Cover\Zorn_John_Nosferatu.jpg"
"L:\Music\FLAC\Z\John Zorn\Nosferatu\16•Stalker Dub.flac" "D:\Daten\CDData\Cover\Zorn_John_Nosferatu.jpg"
"L:\Music\FLAC\S\Andy Statman\Avodas haLevi\08•Lo Seivoshi.flac" "D:\Daten\CDData\Cover\Statman_Andy_Avodas_Ha_Levi.jpg"
"L:\Music\FLAC\S\Andy Statman\Avodas haLevi\09•Charles And West 4th.flac" "D:\Daten\CDData\Cover\Statman_Andy_Avodas_Ha_Levi.jpg"
"L:\Music\FLAC\S\Andy Statman\Avodas haLevi\07•Badekens Niggun.flac" "D:\Daten\CDData\Cover\Statman_Andy_Avodas_Ha_Levi.jpg"
...
"L:\Music\FLAC\S\Andy Statman\Avodas haLevi\03•Breslever Lecha Dodi.flac" "D:\Daten\CDData\Cover\Statman_Andy_Avodas_Ha_Levi.jpg"
"L:\Music\FLAC\S\Andy Statman\Avodas haLevi\02•Modzitzer Deveykus Niggun.flac" "D:\Daten\CDData\Cover\Statman_Andy_Avodas_Ha_Levi.jpg"
"L:\Music\FLAC\S\Andy Statman\Avodas haLevi\01•Reb Nachmans Deveykus Niggun Duet.flac" "D:\Daten\CDData\Cover\Statman_Andy_Avodas_Ha_Levi.jpg"
"L:\Music\FLAC\C\The Cracow Klezmer Band\Remembrance\06•The Prayer.flac" "D:\Daten\CDData\Cover\Cracow_Klezmer_Remembrance.jpg"
"L:\Music\FLAC\C\The Cracow Klezmer Band\Remembrance\07•Awaiting.flac" "D:\Daten\CDData\Cover\Cracow_Klezmer_Remembrance.jpg"
...
"L:\Music\FLAC\C\The Cracow Klezmer Band\Remembrance\02•The Migration of Souls.flac" "D:\Daten\CDData\Cover\Cracow_Klezmer_Remembrance.jpg"
"L:\Music\FLAC\C\The Cracow Klezmer Band\Remembrance\01•Recollections of the Past.flac" "D:\Daten\CDData\Cover\Cracow_Klezmer_Remembrance.jpg"
...
My first question:
Is there a possibility, that The Godfather will tag all the files (round about 8000) with the specified cover art automatically?
I looked for the button [Batch....], but there is no import function.
I looked for the button [Script], but, as far as i understand, the script #load_cover.sct only takes one cover, called folder.jpg, for all selected FLACs.
I do know a little about Delphi, but nothing about scripting in The Godfather, sorry, i'm >pre computer generation< ;-).

Or the question the other way round: How do i have to create a list, that The Godfather will understand? Changing the list shown above to an other structure, separated by semicolon, or with field names, or ... will be no real problem.

At the moment i only found the solution to select one album by the time, select the JPEG, and update the files, all by hand. More then 1500 albums, that's a little bit stupid work. Therefore i would appreciate any help from the computer specialists here very much. I'm more interested in music then in computer things, please be indulgent with my simplistic questions.


Ralf from the south west corner of Germany

User avatar
jtclipper
Administrator
Administrator
Posts: 770
Joined: Tue Aug 10, 2010 12:04 pm

Re: Many Covers From A Long List For Many FLAC Files?

Post by jtclipper »

You can use the following script to do the job.
Test this with a few files first before you run it against your full collection.

Code: Select all

Program LoadCoverFromTxt;

var
  i, iPos: integer;
  sAudioFile, sCoverFile: string;
  sl: TStringList;
const
  _COVER_FILE = 'd:\temp\test.txt';
  _DELIM = ';';
begin

  sl := TStringList.Create;
  sl.LoadFromFile( _COVER_FILE );
  sys_SetStatusText( 2, IntToStr( sl.Count ) );

  for i := 0 to sl.Count - 1 do begin
    iPos := Pos( _DELIM, sl.Strings[ i ] );

    sAudioFile := Trim( Copy( sl.Strings[ i ], 1, iPos - 1) );
    sCoverFile := Trim( Copy( sl.Strings[ i ], iPos + 1, 999));

    sys_SetStatusText( 1, IntToStr( i ) );
    sys_SetStatusText( 3, sCoverFile );

    if FileExists( sCoverFile ) and gTag.ReadFromFile( sAudioFile ) then begin
       gTag.ClearPictures; // remove any existing !!
       gTag.LoadPicture( sCoverFile );
       gTag.SaveToFile( 0, false, false );
    end;
  end;

  sl.free;

end.
You need to include a delimiter to separate the audio file from the cover file ( the default is ; ) and also do not include any quotation marks for the file names.
Also replace _COVER_FILE = 'd:\temp\test.txt' and _DELIM = ';' with your own values.

Code: Select all

L:\Music\FLAC\K\David Krakauer\Pruflas Book of Angels Vol18\01•Ebuhuel.flac;D:\Daten\CDData\Cover\Krakauer_David_Pruflas_Book_Angels_18.jpg
L:\Music\FLAC\K\David Krakauer\Pruflas Book of Angels Vol18\02•Kasbeel.flac;D:\Daten\CDData\Cover\Krakauer_David_Pruflas_Book_Angels_18.jpg
This script was made with the latest beta (0.85) so please use that version because there will be small differences with the 0.81

rawac
Newbie
Newbie
Posts: 2
Joined: Mon Jan 21, 2013 10:33 am

Re: Many Covers From A Long List For Many FLAC Files?

Post by rawac »

Thank you very much for your quick answer.

I have to download and install 0.85 first, i'm still using 0.81. Therefore i can't tell you now, whether it works.

I used the quotation marks, because i was thinking about creating a batch file, to copy every cover from the source directory and paste it into the FLAC directory for the album as new file, named folder.jpg. In a second step the #load_cover.sct may do the job. Not smart, but i had no better idea.

Ralf from the south west corner of Germany

Post Reply