Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Masstagger move and rename (Read 3444 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Masstagger move and rename

I'm already aware of the 'no / inside the $if' requirement for the masstagger, but there seems to be a greater problem caused by this. I have my music separated into an Artist and Soundtrack folder as it just makes sense to me. I use a pretty untidy SOUNDTRACK=1 tag to indicate a soundtrack. Originally I tried this:

Code: [Select]
$if(%soundtrack%, Soundtrack\Subfolder\Subfolder\etc...,
Artist\Subfolder\etc...)


Which ends up with a syntax error, and I can deal with that. However I can't think of a way to get around this; since you cannot have \ inside the $if then you must have a series of $if statements with \ characters between them, ie;

Code: [Select]
$if(%soundtrack%,Soundtrack)\
$if(%soundtrack%,%date% - %album%)\
$if(%soundtrack%,$num(%tracknumber%,2) - %artist% - %title%)


Now the masstagger happily throws away these \ characters if the particular track is not a Soundtrack because it's getting blank directories. However If it is a Soundtrack, the following code checking whether the track is going in Artist is going to append one of it's \ characters on the end of the Soundtrack path\filename already generated.

By Demonstration:

"Soundtrack\2000 - Requiem for a Dream\28 - Clint Mansell - Full Tense.ogg\noname.ogg"

How does one fix this ;P

Masstagger move and rename

Reply #1
...As an side, if anyone is interested I have created an SPC and KEY file for Crimson Editor so all your $functions and %tags% are colour-highlighted, if you don't mind copy-pasting to edit. Not sure if someone has done this already.

Masstagger move and rename

Reply #2
All parts that might generate an empty string should be on an intermediate level, i.e. before the last backslash. If you have trouble understanding what I'm trying to say here, please post your complete titleformat string for the renamer, so I can demonstrate it.

Masstagger move and rename

Reply #3
I didn't want to complicate the question more than necessary, but I am using a third Various folder. I don't actually use it but it's there if I need it, and it doesn't change the problem.

Code: [Select]
$if(%soundtrack%,Soundtrack)\
$if(%soundtrack%,%date% - %album%)\
$if(%soundtrack%,$num(%tracknumber%,2) - %artist% - %title%)

$if(%soundtrack%,,$if(%various%,Various))\
$if(%soundtrack%,,$if(%various%,%date% - %album%))\
$if(%soundtrack%,,$if(%various%,$num(%tracknumber%,2) - %artist% - %title%))

$if(%various%,,$if(%soundtrack%,,Artist))\
$if(%various%,,$if(%soundtrack%,,%artist%))\
$if(%various%,,$if(%soundtrack%,,%date% - %album%))\
$if(%various%,,$if(%soundtrack%,,$num(%tracknumber%,2) - %title%))


(I am of course entering this on one line into the masstagger script thing)

Tracks which are neither under Soundtrack or Various come up fine because there are no unwanted \ characters afterwards; any Soundtracks get the \ appended and thus the problem.

To clarify, the desired result is, to take two examples;
\Artist\Opeth\2002 - Deliverance\03 - A Fair Judgement.ogg
\Soundtrack\1998 - Cowboy Bebop OST 1\05 - Yoko Kanno - Cat Blues.ogg

Masstagger move and rename

Reply #4
Ok, since you have three distinct cases here, you have to either a) make one preset for each of the cases, or b) create a single preset and interleave the three cases. The interleaved formatting string would look like this:
Code: [Select]
// first level
$if(%soundtrack%,Soundtrack,$if(%various%,Various,Artist))\
// second level, skip this for Soundtrack and Various
$if(%soundtrack%,,$if(%various%,,%artist%))\
// third level, equal for all three cases
%date% - %album%\
// fourth and final level
$if(%soundtrack%,$num(%tracknumber%,2) - %artist% - %title%,
$if(%various%,$num(%tracknumber%,2) - %artist% - %title%,
$num(%tracknumber%,2) - %title%))

Of course, you should remove the comments and linebreaks, before pasting this in massrenamer.

To derive this string, I wrote down the condition and format for each of the three cases separately:
  • case 1
    condition: %soundtrack%
    format: Soundtrack\%date% - %album%\$num(%tracknumber%,2) - %artist% - %title%
  • case 2
    condition: $and($not(%soundtrack%),%various%)
    format: Various\%date% - %album%\$num(%tracknumber%,2) - %artist% - %title%
  • case 3
    condition: $and($not(%various%),$not(%soundtrack%))
    format: Artist\%artist%\%date% - %album%\$num(%tracknumber%,2) - %title%
Next, I looked at the different conditions and put together a format string to disinguish them:
Code: [Select]
$if(%soundtrack%,1,$if(%various%,2,3))


Finally, I combined the individual formats using the case distinction string into the above format string.

Masstagger move and rename

Reply #5
Wow, I wasn't expecting such comprehensive help. Thankyou very much.