Reuse %AlbumArtist% for %Artist%

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)
\(%date%\) %album% /)
$num(%tracknumber%,2) ,)
$noop(Various Artists Release)
$if($eq(%albumartist%,Various Artists),%artist% - )%title%

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?

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”.

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.


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

@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.