Glad to hear you got it working.
I understand that this is formatted for easy editing, but I’d like to suggest a couple of things for consideration:
- Rather than having multiple conditional checks for the same condition each with a single action, you can do the check once and combine the actions in the appropriate “then” or “else” block.
- I suspect that
%itle% in the line $if($in(%itle%,soundtrack), $set(Mainfolder1,Sountrack/)) should actually be %title%.
- The
$if($eq($lower(%genre%),musical), $set(Artist1,Musical/)) line is irrelevant because it is later replaced with $if($eq($lower(%genre%),musical), $set(Artist1,%noop%/)).
- The
$if($eq($lower(%genre%),musical), $set(MainFolder1,Musical/)) line is duplicated, thus being executed twice.
- I assume that
%noop% in the line $if($eq($lower(%genre%),musical), $set(Artist1,%noop%/)) is intended to be an empty string. If that’s the case, you can just leave it out.
- Although the spaces after the commas don’t impact the following
$set() functions, avoiding unnecessary spaces is a good habit to get into because they could be included in resulting strings in tags or output from the file naming script, with unintended consequences.
For example, my suggested revision to what you have posted is:
$if($eq($lower(%genre%),soundtrack),$set(Artist1,Sountrack/))
$if($in(%album%,Soundtrack),$set(MainFolder1,Sountrack/)$set(Artist1,Sountrack/))
$if($in(%title%,soundtrack),$set(Mainfolder1,Sountrack/))
$if($eq($lower(%genre%),musical),$set(Artist1,/)$set(MainFolder1,Musical/))
%MainFolder1%
%Artist1%
%Album1%
%MultiDisc1%
%PreTitle2%
%Track1%
%Title%
If you intended to have the genre “musical” set “Artist1” to “Musical/” rather than “/”, then my suggested revision is:
$if($eq($lower(%genre%),soundtrack),$set(Artist1,Sountrack/))
$if($in(%album%,Soundtrack),$set(MainFolder1,Sountrack/)$set(Artist1,Sountrack/))
$if($in(%title%,soundtrack),$set(Mainfolder1,Sountrack/))
$if($eq($lower(%genre%),musical),$set(Artist1,Musical/)$set(Mainfolder1,Musical/))
%MainFolder1%
%Artist1%
%Album1%
%MultiDisc1%
%PreTitle2%
%Track1%
%Title%