Page 1 of 1
Create options to delete tags like in the Tools menu
Posted: Wed Dec 05, 2012 10:14 am
by hopalongrock
I use only mp3 with Id3v2 tag, and always delete lyrics and ape tags in tools.
Maybe TGF could do this automatically, with the help of some new settings in Options / Tags? to retain or clear these other tag types, pictures.
For example I would enable the delete lyrics and delete ape settings, and disable the picture delete setting, because I would delete the pictures from Tools, if I don't need them, rather then always change it's enable/disable setting in the options.
Re: Create options to delete tags like in the Tools menu
Posted: Thu Dec 06, 2012 12:20 am
by jtclipper
There is an option to remove ID3v1 upon save but not ape which has to be done manually for the time being.
Re: Create options to delete tags like in the Tools menu
Posted: Thu Dec 06, 2012 5:33 am
by hopalongrock
jtclipper wrote:There is an option to remove ID3v1 upon save but not ape which has to be done manually for the time being.
Yes, ID3v1 is no problem, I hope you will accomplish the optional/ automatic deletions in the future.
Re: Create options to delete tags like in the Tools menu
Posted: Thu Dec 06, 2012 1:58 pm
by jtclipper
For now you can rely on scripts, for example the following can do what you described (test it first)
If you like you can un-comment the lyrics or pictures lines to delete those also.
Code: Select all
Program UpdateEX;
var
i: integer;
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 );
//gTag.Lyrics := '';
//gTag.ClearPictures;
gTag.SavetoFile( 0, false, false );
gTag.RemoveFromFile( 4, true, false ); //4=ape, true=force remove, false=do not refresh grid row
i := i + 1;
until not tg_skip;
end.
Re: Create options to delete tags like in the Tools menu
Posted: Fri Dec 14, 2012 3:07 pm
by hopalongrock
Now I tried gTag.ClearPictures, it works well, but doesn't reset id3v2 padding. From tools / Sync the padding reset works well.
According to the help, if the 3rd parameter of SaveToFile is true, TGF resets the id3v2 padding, but the file size isn't not reduced.
{function SaveToFile( const iFlg: integer = 0; bBasicOnly: boolean = false; bResetPadding: boolean = false ): Boolean;}
Program PictureTORLES;
begin
if not tg_init then exit;
repeat
tg_loadFile;
gTag.ClearPictures;
gTag.SaveToFile( 0, false, true); // true: ResetPadding
until not tg_skip;
end.
I couldn't find other references of reset padding in scripts.
Re: Create options to delete tags like in the Tools menu
Posted: Fri Dec 14, 2012 4:15 pm
by jtclipper
The 3rd parameter resets padding if set to true, the same method is used internally when you interact with the UI (tools/..).
It should change the file size if conditions are met , if not then there might be a bug in general.
Re: Create options to delete tags like in the Tools menu
Posted: Fri Dec 14, 2012 5:13 pm
by hopalongrock
jtclipper wrote:The 3rd parameter resets padding if set to true, the same method is used internally when you interact with the UI (tools/..).
It should change the file size if conditions are met , if not then there might be a bug in general.
I tried two times, with one-one mp3 containing one jpg - the above script(true the 3rd param) clears the picture, but doesn't reset padding, a subsequent tools/sync/reset shrinks the file
Please examine the problem/script in my previous script.
I tried in 0.81 and 0.71 beta2 too, with the same result (I inserted a '' as 3rd parameter before the now 4th True param) in savetofile.
Re: Create options to delete tags like in the Tools menu
Posted: Sat Dec 15, 2012 9:22 am
by hopalongrock
OK, I found in the help of the previous versions, that in the savetofile there is no "reset padding" parameter.