Conditional Guess


#1

I want to achieve a conditional guess.

source tag %album% needs to be interpreted as 2 tags %album% (%setsubtitle%). I.e. Deep Purple In Rock (Anniversary Edition) would be split in Deep Purple in Rock and Anniversary Edition. Executing 2nd time the script shouldn't do a new split otherwise the 2nd tag will be overwritten.

I tried

$if(%setsubtitle%,%%album%% (%%setsubtitle%%),%%dummy%%)

but it didn't work.

Maybe what I want could be done using temporary tags but I have the feeling conditional guess is feasible. Probably I don't use the correct syntax.

Thank you.


#2

Feelings can be deceiving - but bad syntax is always right - it simply does not work.

A first help can be to set the Mp3tag Filter [F3] using this expression:

"%ALBUM%" MATCHES "^.+? \(.+?\)$"

This reduces the list of files to show only possible candidates.

You can use an action ...

Begin Action Group Test 2011#20110110.VK

Action #1
Actiontype 7: Import tag fields (guess values)
Source format: %ALBUM%
Guessing pattern: %ALBUM% (%SETSUBTITLE%)

End Action Group Test 2011#20110110.VK (1 Action)

DD.20110110.1214.CET

You can use two actions "Format value" ...

SETSUBTITLE <== $if(%SETSUBTITLE%,%SETSUBTITLE%,$regexp(%ALBUM%,'^(.+?)\s\((.+?)\)$','$2')) ALBUM <== $regexp(%ALBUM%,'^(.+?)\s\((.+?)\)$','$1')

DD.20140910.1118.CEST