File Naming

what you’re wanting is quite close to the script I’m using right now… edited slightly as I’ve got a plugin that allows me to group soundtracks and Various Artists separately, and also changed the Various Artist folder name to match your current one.

sorry about the weird formatting, as I’m adjusting it, the formatting helps me keep things straight. :wink:

$if(
	$eq(
		%musicbrainz_albumartistid%,
		89ad4ac3-39f7-470e-963a-56509c546377
		),
		[Various Artists],
		$firstalphachar(
			$if2(
				%albumartistsort%,
				%artistsort%,
				%albumartist%,
				%artist%
				),
				1-9
			)
		/
	$if2(
		%albumartist%,
		%artist%
		)
	)

/

$if(
	%date%,
	\($left(
		%date%,
		4
		)\) 
	)
$if(
	$ne(
		%album%,
		[non-album tracks]
		),
	%album%$if(
		%_releasecomment%,
		 \(%_releasecomment%\),
		)
		/,
	)
$if(
	$gt(
		%totaldiscs%,
		1
		),
	%discnumber%-,
	)
	$if(
		$and(
			%albumartist%,
			%tracknumber%
			),
	$num(
		%tracknumber%,
		2
		) ,
	)
	%title%
	$if(
		%_multiartist%,
		 - %artist%,
		)

For the letter folders, it’ll use the sort-name of an artist first, or the artist name if it doesn’t have a sort-name, favoring album artist over track artist, therefore ABBA, Bryan Adams, and The Angels should all end up under A. Also, if there’s multiple artists on an album, it’ll add the artist after the track title. Any artists that start with anything non-alphabetical, (numbers, symbols, and emoji, for instance) will be put in “1-9”. If you’ve got any [non-album tracks], it’ll put those music files in the artist folder. Lastly, if there’s a disambiguation on your release, it’ll add that in parentheses after the album title.

my script doesn’t separate into discs, but it does handle multiple discs as part of the track number, (i.e. “Radio Ga Ga” on disc 2, track 3 would be rendered as “2-03 Radio Ga Ga.mp3”). it could easily be changed to add separate disc folders if you’d like, either in the artist folder or the release (album) folder.


some actual examples from my collection, notes in {brackets}:

  • [Various Artists] {I use a “#” at the start, but you can use a different character if you want}
    • (1999) The Matrix∶ Music From the Motion Picture (Parental Advisory)
      • 01 Rock Is Dead - Marilyn Manson.mp3 {multiple artist release}
      • 02 Spybreak! (Short One) - Propellerheads.mp3
      • 03 Bad Blood - Ministry.mp3
  • 1-9
    • 4 Non Blondes
      • (1992) Bigger, Better, Faster, More!
        • 03 What’s Up.mp3 {single artist release}
  • A
    • ABBA
      • (2008) Gold∶ Greatest Hits
        • 04 Mamma Mia.mp3
    • Bryan Adams
      • (2014) Reckless (mastered for iTunes) {a couple examples of the disambiguation I mentioned}
        • 06 Summer of ’69 - Bryan Adams.m4a
    • The Angels
      • (1963) My Boyfriend’s Back (stereo)
        • 01 My Boyfriend’s Back.mp3
  • …continues to Z

sorry for the lack of comments in the script itself… I’m still adjusting it at this time, but it works like a dream for me~ lemme know if you have any questions~

edit: I did just remember, I have had “feat.” artists outside the main artist folder in a couple cases, but that’s only when there is no album artist/release.

also, if you’ve got artists with different scripts, it should sort them properly too, for example Hatsune Miku (in my library as “初音ミク”) will be under H, not 1-9.

3 Likes