File renaming with (3) if statements based on availability of tags review

So what I’m trying to do is:

*Non Albums: (single songs from an artist - no album tag or various artists tag)
Artist / Track # (if available) Artist - Year (if available) - Title
*Various Artists: (Album Artist tag is Various Artists)
Album (Disc 2+ if available) - Year (If Available) / Track # - Artist - Title
*Albums: (Regular albums of an artist)
Artist - Year (if available) - Album (Disc 2+ if available) / Track # - Title

Below is the code I made, using the tips / examples on the renaming site, but clearly i’m doing something wrong on the $eq sections because items aren’t renaming the way I expect them to… would anyone mind taking a look at it? I’ve tried dozens of variations but it always seems to use the wrong portion of the if statement… :confused:

Also, the 1/2/3 at the end right before the track name’s only purpose is to see which portion of the if statement was triggering when I was doing sample renaming… :slight_smile:

$if($eq([non-album tracks],%album%),
 %albumartist%
 $if($gt(%totaldiscs%,1),\(Disc $num(%discnumber%,1)\) -)
 $if(%date%,- $left(%date%,4))
 /
 $num(%tracknumber%,2)
 -1
 ,
$if(
 $eq(Various Artists,%albumartist%),
 %album%
 $if($gt(%totaldiscs%,1),\(Disc $num(%discnumber%,1)\) -)
 $if(%date%,- $left(%date%,4))
 /
 $num(%tracknumber%,2)
 -2
 ,
 %albumartist%
 $if(%date%,- $left(%date%,4) -)
 %album%
 $if($gt(%totaldiscs%,1),\(Disc $num(%discnumber%,1)\))
 /
 $num(%tracknumber%,2)
 -3
))%title%

Thanks!

What exactly is it that is not working as expected?

Sorry, that would help I imagine. :smiley:

No matter what type of album I process, it seems to do the if statement about Various Artists. :frowning:

1 Like

I’m not near a computer with Picard on it right now, but I strongly suspect that this is PICARD-383 in action -

$if(
 $eq(Various Artists,%albumartist%),

basically turns into

$if(
<space>,

which is treated as true.

2 Likes

Argh, that is so frustrating.

thank you so much!