Sorting in different folders by file type

Tags: #<Tag:0x00007fe315c64cb0>

I would like to sort my music by Extension, Artist, Album, Track. So I have a MP3, Wav, M4A and so on root folders then Artist, Album, Track.

I would like each file to be renamed, Artist, Album, track when it is moved.

Would someone mind writing a script for this I would greatly appreciate it.
Thanks in advance
Tom

That’s pretty much the default script. So the default will give you albumartist/album/tracknumber tracktitle

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

It will also add the discnumber if it is more than one. It has some other specialities, such as creating the album folder only if there is an album artist, and setting the artist name in front of the track title if the album contains tracks from different artists. If you don’t want this all and really just albumartist/album/tracktitle then you could reduce it to:

$if2(%albumartist%,%artist%)/%album%/%title%

Nice and simple. Now for the file extension there is a variable %_extension%. To have a folder with the extension name just add it to the beginning of the script separated by a slash for the folder separator:

%_extension%/$if2(%albumartist%,%artist%)/%album%/%title%
2 Likes

For consistency, I would probably write this as:

$upper(%_extension%)/$if2(%albumartist%,%artist%)/%album%/%title%

to avoid potentially creating multiple directories on case-sensitive file systems.

2 Likes

Thank you both. At the moment I have a greater problem. The program crashes often. With the default script.

Can you be more specific when exactly it is crashing?

We are also preparing the next release of Picard and have fixed a couple of potential crashes there. I have uploaded a current development build on:

https://s3.eu-central-1.amazonaws.com/artifacts.picard.uploadedlobster.com/picard-setup-2.5.0.dev2.exe

Could you check whether this solved your issue?

If this does not solve you issue, could you report details on a crash by running Picard from command line with the “-d” command line option, make the application crash and post the output on the command line here?

If you are on Windows, make sure you have installed Picard using the installer. Then open a Windows command prompt and start Picard with:

"C:\Program Files\MusicBrainz Picard\picard.exe" -d

It would be great if we could address the crash your experience in time for the next release.

1 Like

I will gladly. However my personal time is very limited. It is why I didn’t sit learn the script language. It may be a few days before I can post again.

Tom

1 Like