Reuse %AlbumArtist% for %Artist%


#1

Been trying to wrap my head around this.
If %albumartist% doesn’t exist, I want %artist% to be substituted for it.

$noop(Single Artist Release)
$if2(%albumartist%,%artist%)/
$if($ne(%albumartist%,),
\(%date%\) %album% /)
$if($gt(%totaldiscs%,1),%discnumber%-,)
$if($ne(%albumartist%,%artist%),
$num(%tracknumber%,2) ,)
$noop(Various Artists Release)
$if($eq(%albumartist%,Various Artists),%artist% - )%title%

#2
$if2(%albumartist%,%artist%)

This does exactly this, it used album artist when present, artist otherwise. Do your file naming should already do what you want. Or is there anything not working as expected?


#3

Well in my case, unless %albumartist% already exists, the result will be “artist/01 song”. The album subfolder is missing, ie “artist/album/01 song”.


#4

Because you have

$if($ne(%albumartist%,),\(%date%\) %album% /)

That will only output “(date) album /” if the album artist is not empty.

Just don’t use the $if:

\(%date%\) %album%/

Likewise your script will only add a track number if the albumartist is different from artist, not sure if this is your intention.


#5

Ahh ok, I think I understand the formatting better. Thanks for the help!


#6

@outsidecontext already answered most of what I would have said, but I will point out that that confusion with different places using different combinations of variables is why I recommend adding $set(_saveartist,$if2(%albumartist%,%artist)) at the beginning, and using %_saveartist% in the rest of the script rather than repeating the $if2 each time. That way, if you decide to switch to using the sort names or something, you only have to change it at one place rather than tracking down everywhere it needs to be fixed.