I could use a little help for a custom script

Tags: #<Tag:0x00007f2a539c1ba0> #<Tag:0x00007f2a539c1a60>


So: I’m trying to organize my collection and I’m looking to rename both files and folders.

I already gave a try to other scripts found here and there in the community, but they just don’t feet my needs.

So I’m kind of summoning your help here, in order to achieve something definitely simple.

I’d like to have something like this:

artist_name -> year - album_name -> 01 - track_name

When it comes to album consisting of two or more discs, I’d like it to be like this:

artist_name -> year - album_name -> cd1 -> 01 - track_name and
artist_name -> year - album_name -> cd2 -> 01 - track_name

As you may have noticed, I’m a HUGE fan of the space-hyphen-space pattern LOL .

I’m asking for help because I’m clearly unable to find a solution: syntax’s never been my thing, oh no.

Thank you so much for your time and patience guys: I appreciate that.


1 Like

Give something like this a try and see if it does what you want. I’m assuming that -> means a directory level… Warning, untested code follows.

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

You might also want to take a look at https://picard.musicbrainz.org/docs/scripting/ and https://picard.musicbrainz.org/docs/tags/ for more information regarding the scripts.

1 Like

Worked like a charm!