Keyboard-shortcut request

Main discussion forum
Post Reply
Russ
Newbie
Newbie
Posts: 5
Joined: Sat Aug 18, 2012 6:40 am

Keyboard-shortcut request

Post by Russ »

Hi

I'm finding TheGodfather to be excellent for organising my ripped CDs' tag info. It really is the best utility available for this task.

Could I please request a feature for the Full Tag Edit function?

Presently, in order to modify an individual mp3/FLAC file's album art, I need to click on the Pictures tab, then on the Insert Picture icon, then select the Load from file drop-down option for each album-art picture.

Please could a keyboard-shortcut be coded to go directly to:
Pictures tab->Load from file (and also a 'Delete picture' key-shortcut)?

If there's an existing way to do this (for individual mp3/FLAC files, not an album in one pass), then please let me know!


Thanks!

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

Re: Keyboard-shortcut request

Post by jtclipper »

Adding those shortcuts is not a big problem as long as you are in the cover art tab of the dialog, I'll see what can be done.

However there is a script that can automatically attach a file into a file based on the picture's name (the default is folder.jpg) and more functionality can easily be added there to automate the process.

Russ
Newbie
Newbie
Posts: 5
Joined: Sat Aug 18, 2012 6:40 am

Re: Keyboard-shortcut request

Post by Russ »

Many thanks, yes selecting the Picture tab first wouldn't be a problem at all. A key-shortcut linked to a discrete button for 'Insert Picture from file' would be perfect. If this could be coded-in, it would make so much difference! :)

Could you also please point me in the right direction for the script and how to go about this? Ideally this would insert the correct picture if the picture filename matches the FLAC/MP3 filename (and add it to the cover description tag). I've not delved into scripting in the GodFather just yet, but I understand that it could save a lot of clicking and typing with 1000s of ripped mp3/FLACs.


Thanks again,
Russ

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

Re: Keyboard-shortcut request

Post by jtclipper »

There is a #load_cover.sct script file available at the tag panel that uses folder.jpg as the default to load cover art.
This is a simple modification to load cover art only if a jpg file exists in the same folder as the music file and has the same filename.
You can create another file like load_coverex.sct and paste the following code

Code: Select all

Program PictureFromFileEX;

var
  i: integer;
  sCoverFile: string;
begin

  if not tg_init then exit;

  i := 1;

  sys_SetStatusText( 2, IntToStr( tg_GetRowCount ) );

  repeat

    tg_loadFile;

    sys_SetStatusText( 1, IntToStr( i ) );
    sys_SetStatusText( 3, gTag.Filename );

    sCoverFile := ChangeFileExt( gTag.Filename, '.jpg' );

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

    i := i + 1;

  until not tg_skip;

end.

Russ
Newbie
Newbie
Posts: 5
Joined: Sat Aug 18, 2012 6:40 am

Re: Keyboard-shortcut request

Post by Russ »

8)

Many thanks!

If I needed to modify the script to only look in a particular directory for the .jpg (eg. 'D:\Album Art') and for MP3/FLAC filename matches, excludes the first 3 characters of the filename (eg. for "01 Artist - Title.mp3", it would look for "Artist - Title" to get a .jpg match), please could you let me know how could I do that in the script?

Once again, thank you!

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

Re: Keyboard-shortcut request

Post by jtclipper »

Try this one, all you have to do is set the correct value for _COVER_FOLDER

Code: Select all

Program PictureFromFileEX;

var
  i: integer;
  sCoverFile: string;
const
  _COVER_FOLDER = 'd:\temp\';
begin

  if not tg_init then exit;

  i := 1;

  sys_SetStatusText( 2, IntToStr( tg_GetRowCount ) );

  repeat

    tg_loadFile;

    sys_SetStatusText( 1, IntToStr( i ) );
    sys_SetStatusText( 3, gTag.Filename );

    sCoverFile := ChangeFileExt( _COVER_FOLDER +  Trim( Copy( ExtractFilename( gTag.Filename ), 4, 999 ) ), '.jpg' );

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

    i := i + 1;

  until not tg_skip;

end.

Russ
Newbie
Newbie
Posts: 5
Joined: Sat Aug 18, 2012 6:40 am

Re: Keyboard-shortcut request

Post by Russ »

Many thanks, the pictures are inserted correctly with this script: works well and a real time-saver!! :)

However, the Description text for the inserted pictures show as "Album cover". Can you please tell me how it can be scripted to show the name of the jpg file instead (without the extension), as TGF does when pictures are inserted manually? That would make the script perfect!

Thank you!

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

Re: Keyboard-shortcut request

Post by jtclipper »

This will do

Code: Select all

Program PictureFromFileEX;

var
  i: integer;
  sCoverFile, sFileName: string;
  ms: TMemoryStream;
const
  _COVER_FOLDER = 'd:\temp\';
begin

  if not tg_init then exit;

  i := 1;
  ms := TMemoryStream.Create;

  sys_SetStatusText( 2, IntToStr( tg_GetRowCount ) );

  repeat

    tg_loadFile;

    sys_SetStatusText( 1, IntToStr( i ) );
    sys_SetStatusText( 3, gTag.Filename );

    sFileName := Trim( Copy( ExtractFilename( gTag.Filename ), 4, 999 ) );
    sCoverFile := ChangeFileExt( _COVER_FOLDER + sFileName , '.jpg' );

    if FileExists( sCoverFile ) then begin
       ms.Clear;
       ms.LoadFromFile( sCoverFile )
       gTag.ClearPictures; // remove any existing !!
       //gTag.LoadPicture( sCoverFile );
       gTag.AddPicture( ms, ChangeFileExt( sFileName, '' ), 'jpg', 3 );
       gTag.SaveToFile( 0, false, '', false );
    end;

    i := i + 1;

  until not tg_skip;
  ms.Free
end.

Russ
Newbie
Newbie
Posts: 5
Joined: Sat Aug 18, 2012 6:40 am

Re: Keyboard-shortcut request

Post by Russ »

Perfect! Many thanks for your help with this; much appreciated.

Post Reply