Still dont understand file renaming

I have deal a lot of hours to get my renaming work, but i have still problems and i don’t understand totally syntax how this should work. I find here some script what almost works, but I don’t get a work as I want
Folder naming Artist → Album(year) > songs works
Songs renaming
Single artist album (artist - song nr(01) - title) works
Artist multi cd album ( cd nr(1) - artist - song nr(01) - title) don’t work, always artist -song nr- title
The compilation cd (song nr(1) - artist - title) don’t work, song nr always 01
The compilation multi cd (cd nr(1)-song nr(01) artist-title) works

code:

$if2(%albumartist%,%artist%)/
$if(%albumartist%,%album% $if(%date%,($left(%date%,4)))/,)
$if(%_multiartist%,$if($gt(%totaldiscs%,1),%discnumber%-)$num(%tracknumber%,2) $if2(%artist%,%albumartist%),$if2(%albumartist%,%artist%) - $if($gt(%totaldiscs%,1),%discnumber%-)$num(%tracknumber%,2)) - %title%

According to you script the disc number should be printed if there is more than one disc ($if($gt(%totaldiscs%,1),%discnumber%-)), but not in front of the artist name
but directly in front of the tracknumber.

Change:

$if2(%albumartist%,%artist%) - $if($gt(%totaldiscs%,1),%discnumber%-)$num(%tracknumber%,2)

to

$if($gt(%totaldiscs%,1),%discnumber% - )$if2(%albumartist%,%artist%) - $num(%tracknumber%,2)

I am not sure I understand this. Do you say the track number is always 1, even for the second track? Or do you just in case of compilations have the track number not formatted with leading 0? If it is the latter: The formatting of the numbers as 01 is done with the $num function. So $num(%tracknumber%,2) formats the tracknumber with a leading 0 if it is only single digit. If you don’t want this either change it to $num(%tracknumber%,1) or just don’t use $num at all and just do %tracknumber%.

2 Likes