Scripting Possibilities

Use this forum for everything concerning script usage
Post Reply
sushi
Newbie
Newbie
Posts: 5
Joined: Tue Dec 28, 2010 8:34 pm

Scripting Possibilities

Post by sushi »

Hello everybody,
I started to make scripts with The GodFather to create automatic tags for my MP3 files but finally, I didn't find the right script, the right functions, etc.
Can you help me please ?

I would make a script doing this :
1) Save in variables : the title, the artist and the picture (if existing) of the ID3v2 tags of my MP3 files
2) Remove ID3v1 & ID3v2 tags.
3) Create IDv2 tags with only the title, the artist and the picture (if existing) saved previously.
4) Save the result in the MP3 file.

First, is it possible ?
Somebody got an idea ?

Thanks !  ;)

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

Re: Scripting Possibilities

Post by jtclipper »

Hello,
First of all go to main options/tags/ID3 and in the update section select ID3v2 and click the remove ID3v1
then use this code to uodate your files

Code: Select all

Program CustomUpdate;

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.Track := '';
    gTag.Album := '';
    gTag.Genre := '';
    gTag.Year := '';
    gTag.Comment := '';
    gTag.Language := '';
    gTag.Composer := '';
    gTag.Copyright := '';
    gTag.URL := '';
    gTag.EncodedBy := '';
    gTag.Tones := '';
    gTag.Styles := '';
    gTag.Mood := '';
    gTag.Situation := '';
    gTag.Rating := '';
    gTag.Quality := '';
    gTag.Tempo := '';
    gTag.Type_ := '';

    gTag.OrigAlbum := '';
    gTag.OrigArtist := '';
    gTag.OrigYear := '';
    gTag.Performer := '';
    gTag.Description := '';
    gTag.Subtitle := '';
    gTag.ContentGroup := '';
    gTag.Conductor := '';
    gTag.Band := '';
    gTag.MixArtist := '';
    gTag.PartInSet := '';
    gTag.MediaType := '';
    gTag.Publisher := '';
    gTag.EncoderSettings := '';
    gTag.RecordDate := '';
    gTag.RecordLocation := '';
    gTag.Organization := '';
    gTag.Catalog := '';
    gTag.EAN_UPC := '';
    gTag.ISBN := '';
    gTag.LC := '';
    gTag.ISRC := '';
    gTag.BPM := '';
    gTag.InvolvedPeople := '';
    gTag.WWWCommercialInfo := '';
    gTag.WWWCopyright := '';
    gTag.WWWAudioFile := '';
    gTag.WWWArtist := '';
    gTag.WWWAudioSource := '';
    gTag.WWWRadioPage := '';
    gTag.WWWPayment := '';
    gTag.WWWPublisher := '';
    gTag.Lyrics := '';
    gTag.Lyricist := '';
    gTag.OrigLyricist := '';

    gTag.ExtraFieldsRemove;

    gTag.SaveToFile( 0, false, '', false );

    tg_setresult( 'OK' );

    Inc( i );

  until not tg_skip;

end.
Might seem long but it is faster than saving or removing fields/tags first and saves a lot of file IO.

It will not update the values in the grid (clean clomuns not used ) but that can be easily done also
Last edited by Anonymous on Wed Dec 29, 2010 12:31 pm, edited 1 time in total.
Dimitris

sushi
Newbie
Newbie
Posts: 5
Joined: Tue Dec 28, 2010 8:34 pm

Re: Scripting Possibilities

Post by sushi »

Thank you very much !
Finally this way is the best.

But I still have some questions :

Is there a gTag property for : Date, Time, Original Filename, File owner/licensee, Internet radio station name & Internet radio station owner ? (I found these properties in the "More data" tab of the Full Tag Edit mode)

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

Re: Scripting Possibilities

Post by jtclipper »

Unfortunetly those properties and a few others that belong to specific tag types (ID3v2 only, mp4 only and so on ) are not published in gTag.
Keeping a note of that though and will try to add more support for those.
Dimitris

sushi
Newbie
Newbie
Posts: 5
Joined: Tue Dec 28, 2010 8:34 pm

Re: Scripting Possibilities

Post by sushi »

Ok cool.
Thank you very much !  ;)

Post Reply