Need help with filenaming script

Hello,

I have made a filenaming script which will only add the album artist to the folder name when it’s not Various Artists.

This is almost working, but now because it’s %albumartist% - %album%, it will remove the album artist, but not the dash.

So the folder looks like this when the album artists are various artists: - This is Trance (1999)

This is the filenaming script:

/$if($and($eq(%compilation%,1), $eq(%albumartist% - ,Various Artists)), $unset(albumartist) $unset(albumartistsort))%albumartist% - %album% ($if(%date%,$left(%date%,4),0000))$if($eq($upper(%_extension%),MP3), $upper([%_extension%]))

/$if($gt(%totaldiscs%,1), CD %discnumber%/)

/$num(%tracknumber%,2) %artist% - %title%

I have already added the dash after %albumartist%: /$if($and($eq(%compilation%,1), $eq(%albumartist% - ,Various Artists)),

But this does not work.
How can I remove the dash also?

Thank you in advance.

Instead of %albumartist% - %album% use $if(%albumartist%,%albumartist% - )%album%.

This checks whether albumartist is set and only if it is it adds it and the spaces and dash.

1 Like

It works like a charm, thanks!

1 Like