[SOLVED] Renaming script by original year - album - release date


I’ve been contributing a bit to expand and improve accuracy of the database. Now, my turn to ask for some support regarding renaming script, if you kindly help. Appreciate it indeed.

Debian default MusicBrainz produces the following:
/Artist/Album/Track Title
/Iron Maiden/The Number of the Beast/01 Invaders.mp3

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

As I would like my collection chronologically sorted, could you please clarify how to get…

/Artist/Original year - Album (Date)/Track Title
/Iron Maiden/1980 - The Number of the Beast (2003)/01 Invaders.mp3

That is, firstly the original year when the album was released (from original release date or original year tag) and, between brackets the current release date (date tag), be it a year, year-month or year-month-day.

Thank you again in advance and please let me know if you need additional details to support my help request.


1 Like

have a look at this post i don’t know if it is what your trying to do but it sounds similar How to get Picard writing the original release date / year of a recording?

Try something like the following and see if it does what you want.

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

This would go in the file naming script section.



Thank you for your replies.

@rdswift Your proposal is amazing! Thank you so much! I’ve been reading about variables, scripting and tags in to gain a better understanding in scripting and tags.

I was working on it and this is how close I got:

$if($ne(%albumartist%,),%originaldate% - %album% \(%date%\))/
$if($gt(%totaldiscs%,1),%discnumber%,)$if($ne(%albumartist%,),$num(%tracknumber%,2) ,)$if(%_multiartist%,%artist% - ,)%title%```

Your second $if2 has been so clarifying, and those 0000 and ---- so useful at the same time. Great! I have made a couple of minor edits to your code to better suit my needs in regard to the original date and original year variable length and order. I had to escape the brackets, though, for it to work in Debian. Do not know whether it applies to other platforms as well.

Final script:

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

Thank you once more and regards,


Yeah it does in Windows too. Sorry, I missed that.