Genre and Grouping

One of the things that I do here to provide different naming scripts for different situations (e.g.: Pop / Rock versus Classical) is to combine the various scripts in the naming script, and wrap each of them in an $if() function such as:

$if($eq(%_nametype%,pop),pop naming script goes here,)

or

$if($eq(%_nametype%,classical),classical naming script goes here,)

Then I just use a separate script to set the _nametype variable as

$set(_nametype,pop)

or

$set(_nametype,classical)

In most cases, I can set the naming type automatically based on some logic (e.g.:

$if($or($eq(%primaryreleasetype%,soundtrack),$eq(%secondaryreleasetype%,soundtrack)),$set(_nametype,soundtrack))

But I haven’t yet found the appropriate combination of logical tests to automatically determine when to use the classical naming script, thus the separate setting script.

An alternative, which is closer to the way you suggested is to keep your naming script very simple as:

$if(%_outputpath%,,$set(_outputpath,%albumartist% - %album%)
$if(%_outputname%,,$set(_outputname,%title%)
%_outputpath%/%_outputname%

and then have each of your five scripts set the values of _outputpath and _outputname accordingly. That way you could simply select the script you want to do the processing and avoid any copy ‘n’ pasting or editing of the scripts. Note that I included setting some very basic default values for _outputpath and _outputname just in case none of the processing scripts are selected and the values are blank.

In fact, I really like your suggestion and think I may modify my setup here to keep the different naming style scripts separate. It will make it a bit cleaner when editing one of the styles, and will avoid having a huge master script. Thanks for that.

The beauty is that there are a few different ways of achieving what you want, so I suggest that you pick one that you’re comfortable using and go with it.

That’s caught me on occasion too, but it’s usually because I haven’t taken into account the way the processing occurs within Picard. @dns_server explains the order in:

Things generally seem to work as expected if I do a refresh on the metadata from MusicBrainz (in the right-hand pane) after making any changes to scripts (including selecting / deselecting) and before performing the renaming.

3 Likes