Restructure only those with correct file name?

Main discussion forum
Post Reply
curseworship
Newbie
Newbie
Posts: 3
Joined: Wed Jul 15, 2020 5:49 am

Restructure only those with correct file name?

Post by curseworship »

I’m trying to tag and rename a huge library of files. Because of the number of files, Godfather hangs on me when it is done scanning. So I am trying to do it in pieces (using ESC to end the scan after 100K files etc)

Anyway, my plan is to update a chunk of files - tags and file names - and then move them to a new, clean directory

The problem I have is that when I do restructure with “process correct only” it seems to only be looking for correct tags and ignoring files which have incorrect file naming conventions

Is there a way to restructure only files which have been renamed to match the criteria on the Edit screen?

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

Re: Restructure only those with correct file name?

Post by jtclipper »

The “process correct only” option just looks at the already created file tree and process the appropriate node.

It might be possible to make use of a user script variable and then assign it to the global filter.
I will need more info on what your filenames should be like, flagging them as correct or not, then give it a go.

curseworship
Newbie
Newbie
Posts: 3
Joined: Wed Jul 15, 2020 5:49 am

Re: Restructure only those with correct file name?

Post by curseworship »

Thank you for the response

My correct file names are structured %A%-%L%-%T% with a mix of different file types (.mp3, .m4a etc)

Along the same lines, it would be a good feature to have the EDIT functionality be able to scan and return correct only (the opposite of “ignore correct”

Lastly, is there a way to enter a maximum number of characters on EDIT file rename? Let’s say I am using %A%-%L%-%T% filename structure but have some album names which are very long. Is there a way to take only the first 10 (as an example) letters of the album name instead of the full name?

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

Re: Restructure only those with correct file name?

Post by jtclipper »

You can use this code in a user defined-script variable
Go to File/Options/Variables %..% then go to the User page and the Scripts section , click manage and create a new one, save and give it a name

Code: Select all

var
  sFileName, sTag: string;
begin

  sFileName := ExtractFileName( gTag.Filename );
  sTag := sys_RemoveIllegalChars( gTag.Artist ) + '-' +
          sys_RemoveIllegalChars( gTag.Album )  + '-' +
          sys_RemoveIllegalChars( gTag.Title )  + '.' + gTag.FileExt;

  if UpperCase( sFileName ) = UpperCase( sTag ) then var_result( '1' );

end.
After that make sure you click OK (or apply) on the options dialog to compile the variable.

Now on the Filter section on the left lower panel make a new filter select this variable, use the = Operator and enter 1 as value

As for the last question you can use parts of a field like so

Code: Select all

%* , , % Range - return part of the field

Examples:
Title: Hotel California

%*T,1,1%   -> H
%*T,2,0%   -> otel California
%*T,-2,1%  -> i
%*T,-2,0%  -> ia

Post Reply