$if(x,y,z) not working as expected


I am using Mp3tag v3.24 in windows 11.

I want to restructure my library using a different tree for classical music and not classical.

For classical, I want to create a directory with composer name, and for non classical, a directory for artist instead.

My conversion string is :
D:\Lib\%genre%\%contentgroup%\$if(strcmp(%genre%,"Classical"),%composer%,%artist%)\%album%\$num(%track%,2) - %title%

if %genre% is "Classical", $if does return %composer%

But if not "Classical", $if returns nothing instead of %artist%

What am I doing wrong ?


You are missing the $ in strcmp?

Also, I think that the string constant should not have the " around it. Otherwise the genre would have to be "Classical" and not just Classical.

You can test the expression in the preview.
I think it should be:
D:\Lib\%genre%\%contentgroup%\$if($strcmp(%genre%,Classical),%composer%,%artist%)\%album%\$num(%track%,2) - %title%

Thanks. that was the missing $ ... I must have been blind.

As for the "", they do not make any difference.