Custom naming/moving script - HELP


#1

Hello guys. My first post here.

I downloaded Picard mere minutes ago, so I am completely new to the app. I don’t have a large music collection, however it needs some cleaning up and sorting. I have a lot of single (EP) releases though.

I want to name my files like this:

Artist Name (&/vs Another Artist / feat. Vocalist) - Track Name (Original Mix/Artist Name Remix/or something similar – if necessary).ext

Then I want it moved to it’s appropriate Artist folder (because that’s how I search my music), and then, inside that, there should be an album name, with the year.

Example as follows, for a track named Ladyblue (Original Beat) by Airwave, released on the Ladyblue album, in 2004.

Music/Airwave/Airwave - Ladyblue (2004)/Airwave - Ladyblue (Original Beat).mp3

But sometimes the artists on an album aren’t the album artists. Example of a track called Dangerous Power by Gabriel & Dresden featuring Jan Burton, in the Kuffdam & Plant remix, on CD #4.

Music/VA/VA - A State of Trance Classics vol. 10 (2015)/CD 4/Gabriel & Dresden feat. Jan Burton - Dangerous Power (Kuffdam & Plant Remix).mp3

I think that should be the most complicated case I could think of. :grinning:

However, I am completely new to Picard, even more so when it comes to scripting. For you advanced scripters it’s basically nothing.

Is there any way you could help me? Maybe some of you even name your files that way and you have the script?

Thank you very much in advance.

Cheers!


#2

I haven’t tested this, but I think something like the following as a file naming script will do the trick for you.

%albumartist%/%albumartist% - %album% ($left(%date%,4))/$if($gt(%totaldiscs%,1),CD %discnumber%/,)%artist% - %title%

Note that this would be all on one line. You would set the output directory to be your “Music” directory, which is why it’s not included in the rename script. You can also include the track number if you like, but I didn’t show it in the script because it wasn’t in your examples.

Hope this helps.


#3

Thanks, man! :slight_smile:

I will try it right now, will share how it goes.


#4

UPDATE:

Works good, but a pre-requisite for it to work is the right tags in the first place. Some don’t have that so I’ll have to manually edit. But that’s not the script’s fault.

However, I have some suggestions to improve the script.

Like, ‘vs’ should only be written like that, with all lower caps, Original Mix/Remix etc should always start with the first upper case letter, ‘of’, ‘or’, ‘and’ etc should be in lower caps…

Other thing - I have separate folders for artists, let’s say, Armin van Buuren and a separate folder for Armin van Buuren feat. Justine Suissa. I’d love it if it all went into Armin van Buuren folder. Although that could have its disadvantages.

Any modifications to the script that would enable that?

Thanks again.


#5

For the case related stuff, you’d have to play around with the $upper(), $lower(), $replace() and $rreplace() functions. For the full set of script functions see Scripting Documentation and for the available tags, see Tags Documentation. The easiest way that I know of to get the information about the first artist listed (the primary artist) is to add a plugin that I recently developed.


#6

Keep in mind that anyone can edit MusicBrainz, including you. So if data in MusicBrainz is missing or wrong, you can add/edit it directly in the database and Picard will pick up the data from there. It might be slightly more work for you, but it’s work you only have to do once (theoretically, anyway), even if you lose all your files and have to re-download them or you have an accident where all tags get wiped from your files (e.g., a badly configured tag editor) or what have you. Also, it will help the next person that comes along and wants to tag using this data (just as you’re using data added by lots of other users who initially likely added the data for their own usage). :slight_smile: