Repository for neat file name string patterns and tagger script snippets

@hbrtkp I am using This script and I really like it. I was wondering if you could show me how to add
$if($eq(%media%,SHM-CD), [SHM-CD])
and add if [CBR 320] for mp3’s that are.
That would do it for me, Thanks.

It depends on where this information should be displayed. If at the end, do this:

$swapprefix($if2(%_artists_album_primary_std%,%artist%),The,Die,Le)
/$replace($replace($replace($replace($replace($replace($swapprefix($if2(%albumartist%,%artist%),The,Die,Le), and , & ),+,&), with , & ), _ , & ), vs , & ), vs. , & ) - $replace($truncate(%album%,100),:,-)
$set(album,$if($title(%_releasecomment%),%album% \($title(%_releasecomment%)\),%album%))

$if($gt(%totaldiscs%,1), %totaldiscs%CD

$if($eq(%media%,LP), [Vinyl])
$if($eq(%media%,Vinyl), [Vinyl]))
$if($eq(%media%,7" Vinyl), [Vinyl])
$if($eq(%media%,10" Vinyl), [Vinyl])
$if($eq(%media%,12" Vinyl), [Vinyl])
$if($eq(%media%,Cassette), [Cassette])

$if($eq(%releasestatus%,promotion), [Promo])
$if($eq(%releasestatus%,bootleg), [Bootleg])

$if($ne_all(%catalognumber%,none,[none]),$if(%catalognumber%, [$rsearch(%catalognumber%,\(.+?\)\(?:; |\$\)+)]))

$if(%date%, [%date%],)

$if($eq(%releasetype%,album), [Album],
$if($eq(%releasetype%,single), [Single],
$if($eq(%releasetype%,ep), [EP],
$if($eq(%releasetype%,broadcast), [FM],
$if($eq(%releasetype%,other), [Other],
$if($inmulti(%releasetype%,dj-mix), [DJ Mix],
$if($inmulti(%releasetype%,remix), [Remix],
$if($inmulti(%releasetype%,soundtrack), [OST],
$if($inmulti(%releasetype%,live), [Live],
$if($inmulti(%releasetype%,mixtape/street), [Mixtape],
$if($inmulti(%releasetype%,compilation), [Compilation],)))))))))))

$if($ne(%_extension%,mp3), $upper(%_extension%))

$if($gt(%_bits_per_sample%,16), %_bits_per_sample%bit,)
$if($gt(%_sample_rate%,48000), $div(%_sample_rate%,1000)kHz,)

$if($eq(%media%,SHM-CD), [SHM-CD],)
$if($eq(%_bitrate%,320.0), [CBR 320],)

/$if($gt(%totaldiscs%,1),CD$num(%discnumber%,2)$if(%discsubtitle%, - %discsubtitle%,))
/$num(%tracknumber%,2). $if(%_multiartist%,%artist% - ,)%title%

If elsewhere, paste the code into a free line in the required place.

For the remaining bitrates, use this (works only with CBR files):

$if($eq(%_bitrate%,320.0), [CBR 320],)
$if($eq(%_bitrate%,256.0), [CBR 256],)
$if($eq(%_bitrate%,192.0), [CBR 192],)
$if($eq(%_bitrate%,160.0), [CBR 160],)
$if($eq(%_bitrate%,128.0), [CBR 128],)
$if($eq(%_bitrate%,64.0), [CBR 64],)

Effect:
obraz

1 Like

Got it, Thanks so much. Really like this script so far! :wink:

I’m almost there…
Just wanted to share with everyone my script so far. Really have to thank @hbrtkp for all the inspiration and the base of this script. Now v2.0

1st you will need 3 scripting files
1: 4 Digit Date: $set(date,$left(%date%,4))
2: Release Comment: $set(album,$if(%_releasecomment%,%album% ($title(%_releasecomment%)),%album%))
3: Remove feat from album title: $set(album,$rreplace(%album%,\s\(feat. [^)]+\),))

$if($gt(%_bits_per_sample%,16),-=[%_bits_per_sample%bit]=-,)/
$upper(%_extension%)/
$if($inmulti(%releasetype%,soundtrack),Soundtracks,$swapprefix($if2(%artists_album_primary_std%,%artist%),The,Die,Le))
/$replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($swapprefix($if2(%albumartist%,%artist%),The,Die,Le),“,‘’), meets , & ), X , & ), × , & ),; , & ), x , & ), | , & ), • , & ), ⋅ , & ), and , & ),+,&), with , & ), vs , & ), vs. , & )-$replace($replace($truncate(%album%,100),”,‘’),:,-)
$if($eq(%releasestatus%,promotion),-PROMO,)
$if($eq(%releasestatus%,bootleg),-BOOTLEG,)
$if($ne_all(%catalognumber%,none,[none]),$if(%catalognumber%,$upper(-($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($rsearch(%catalognumber%,(.+?)(?:; |$)+),
,),⋅,),/,),:,),*,),?,),",),<,),>,),|,), ,)))))
$if($eq(%releasetype%,single),-(CDM SINGLE),
$if($eq(%releasetype%,ep),-EP,
$if($eq(%releasetype%,broadcast),-FM,
$if($eq(%releasetype%,other),-OTHER,
$if($inmulti(%releasetype%,dj-mix),-DJ MIX,
$if($inmulti(%releasetype%,remix),-REMIX,
$if($inmulti(%releasetype%,soundtrack),-OST,
$if($inmulti(%releasetype%,live),-LIVE,
$if($inmulti(%releasetype%,mixtape/street),-MIXTAPE,
$if($inmulti(%releasetype%,compilation),-COMPILATION,))))))))))
$if($gt(%_bits_per_sample%,16),-[%_bits_per_sample%bit,)
$if($gt(%_sample_rate%,48000), $div(%_sample_rate%,1000)kHz],)
$if($in(%media%,Vinyl),-VINYL,)
$if($in(%media%,Cassette),-CASSETTE,)
$if($eq(%media%,Hybrid SACD),-[Hybrid-SACD],)
$if($eq(%media%,SACD),-[SACD],)
$if($eq(%media%,SHM-CD),-[SHM-CD],)
$if($eq(%media%,SHM-SACD),-[SHM-SACD],)
$if($eq(%media%,Digital Media),-WEB,)
$if($eq(%media%,Blu-spec CD),-[BLU-SPEC],)
$if($in(%media%,CD),$if($gt(%totaldiscs%,1),-%totaldiscs%CD,-CD),)
$if($in(%media%,Vinyl),$if($gt(%totaldiscs%,1),-%totaldiscs%LP,),)
$if($in(%media%,Digital Media),$if($gt(%totaldiscs%,1),-%totaldiscs%xDIGITAL MEDIA,),)
$if($ne(%_extension%,mp3),$upper(-%extension%))
$if(%date%,-%date%,)-PiCARD, ,
)
/$if($in(%media%,Vinyl),$if($gt(%totaldiscs%,1),LP$num(%discnumber%,2)$if(%discsubtitle%, - %discsubtitle%,)))
$if($in(%media%,CD),$if($gt(%totaldiscs%,1),CD$num(%discnumber%,2)$if(%discsubtitle%, - %discsubtitle%,)))
$if($in(%media%,Digital Media),$if($gt(%totaldiscs%,1),Digital Media $num(%discnumber%,2)$if(%discsubtitle%, - %discsubtitle%,)))
/$if($in(%media%,Vinyl),%_musicbrainz_tracknumber%,$if($gt(%totaldiscs%,1),%discnumber%,)$num(%tracknumber%,2)). $if($and(%_multiartist%,$not($inmulti(%releasetype%,soundtrack))),%artist% - ,)$truncate(%title%,70)

Effect:
Annotation%202019-10-27%20111733

3 Likes

Hello,
your script is excellent.
Would you please a “genre” metatag parenting all this?
Thank you in advance.

My workflow is to place the items in directories based who, what, when then format type, finally the tracks and their bit rate if applicable.

This way I can just keep an ongoing archive and add to it. For the playable music library I’ll duplicate from the archive to that location.

Incomplete Albums are also placed along side the others in the Artists or other Root Folder type.

29-Sept, 2019 - I updated the script, cleaned up orphaned bits, added more configuration options to dis/enable things instead of having to comment them out.

This way I can see what I have both by file type and quality where applicable. The files will have the sample rate and bit rate in the filename as applicable so I can compare quality among the same file format.

Duplicate File Handling: (As shown in my screen shot)

Picard handles duplicate files by placing them in the same directory with an appended filename. (…music/A/Artist/Album/File.ext, …music/A/Artist/Album/File(1).ext, etc.

I wanted the duplicates to be placed in a separate directory at the prior level, (…music/A/Artist/Album, …music/A/Artist/Album(1), etc. instead.

This script works transparently with either configuration, however the latter does require a source code change at this time. That is, you will have to change in the application source code to get this alternate behavior.

This is for several reasons, most having to do with not wanting to rename files when settling on which to use for a particular player/application. Although the need for ‘renaming’ is brought to a minimum when the filename is set to include several file specific metrics. That means those close but not identical named tracks will end up in the same album directory and not the incrememtial duplicate locatoin.

All of that is because I use Picard to organize the data from an archival viewpoint. I target Picard’s output to a directory tree for archiving and I can choose what I want from there when sifting out a set of files for the playback method/hardware. It also makes taking similar files that would have been named as a duplicate otherwise a bit more efficient.

See this thread for details on the source code modification for the latter behavior:

$noop(★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★)
$noop(★ MBP YA Magic-Script that does more stuff too. - v1.6 --amd/17500mph  ★)
$noop(★                                                                      ★)
$noop(★ Here is a script for music renaming in MusicBrainz Picard            ★)
$noop(★                                                                      ★)
$noop(★ Features :                                                           ★)
$noop(★ - Organize root music directory by last.fm** category OR artist      ★)
$noop(★ - Can use custom subDirectory for each main type [Album/Single/EP...]★)
$noop(★ - Separate Root directory for compilations [!various]                ★)
$noop(★ - Type Album [Artist inclusive] can be excluded from Compilations    ★)
$noop(★ - Root directory Audio Books, Podcasts, Others                       ★)
$noop(★ - Alphabetize artist without leading "The"                           ★)
$noop(★ - Show Album Release Status on Album Directory                       ★)
$noop(★ - Show Record Label on Directory Name Directory                      ★)
$noop(★ - Show Track Duration in Filename                                    ★)
$noop(★ - Show Catalogue Number in Album Directory Name                      ★)
$noop(★ - Filtered character for files & directory naming                    ★)
$noop(★ - Include media type in directory name [when its not CD]             ★)
$noop(★ - Multi-Disc SubDirectory per Disc in Album Directory                ★)
$noop(★ - Custom directory tag for multi-disc CD/Vinyl [CD1/Disc1 by default]★)
$noop(★ - Put multi-CD release in same directory [names become 101/102/201..]★)
$noop(★ - Vinyl can use musicbrainz style for track [A1/A2/B1...]            ★)
$noop(★ - Put incomplete in separate album level named directory             ★)
$noop(★ - Added subDirectory for type [video]                                ★)
$noop(★ - Lossy / Lossless** at root directory                               ★)
$noop(★ - File Type SubDirectory in Album Directory                          ★)
$noop(★                                                                      ★)
$noop(★ ** Optional Plugins Needed for certain options:                      ★)
$noop(★   - Last.fm.ng plugin [for category trending]                        ★)
$noop(★   -> https://github.com/fdemmer/Picard-Last.fm.ng-Plugin             ★)
$noop(★                                                                      ★)
$noop(★ Plugin for is_lossless / is_lossy                                    ★)
$noop(★ https://community.metabrainz.org/t/categorizing-lossless-music/258530★)
$noop(★                                                                      ★)
$noop(★ Do Not Taunt The Happy Tagging Ball                                  ★)
$noop(★                                                                      ★)
$noop(★----------------------------------------------------------------------★)
$noop(★   Based on the MBP Magic Script  By Ski-lleR                         ★)
$noop(★   Thanks to avibrazil for his filter                                 ★)
$noop(★ > https://github.com/avibrazil/picard-scripting                      ★)
$noop(★----------------------------------------------------------------------★)
$noop(★                                                                      ★)
$noop(★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★)

$noop(★ INSERT COIN ★)

$noop(Configuration Section - 0-Disable / 1-Enable)

$noop(★ GLOBAL ★)
$set(_separateByTypeInArtistDirectory,1) $noop(Album Name/EP/Single/Live/Tribute etc.)
$set(_separateAlbum,0) $noop(Albums in SubDirectory as well)
$set(_useMusicBrainzStyleForVinylTrack,1)
$set(_extraTrackHandling,1) 


$noop(★ Multi-Disc ★)
$set(_useSubDiscDirectory,1)
$set(_mergeDiscWhenNotUsingSubDirectory,0)
$set(_showDiscSubtitle,1)
$set(_nameForTypeCD,Disc)
$set(_nameForTypeVinyl,Side)


$noop(★ Separate at Root Level by two main categories ★)
$set(_rootLossyLess,0)
$set(_lossySubDirectory,MP3/)
$set(_losslessSubDirectory,FLAC/)


$noop(★ orderTypeForRoot ★)
$noop(★  1: Category [Last.fm.ng] ★)
$noop(★  2: Artist first letter ★)
$set(_orderTypeForRoot,2)


$noop(★ orderTypeForArtist ★)
$noop(★  1: First letter of first name ★)
$noop(★  2: First letter of last name ★)
$set(_orderTypeForArtist,2)


$noop(★ CUSTOM SUBDIRECTORY BY TYPE ★)
$set(_albumSubDirectory,Album/)
$set(_coverSubDirectory,[Cover]/)
$set(_singlesSubDirectory,[Single]/)
$set(_epSubDirectory,[EP]/)
$set(_broadcastSubDirectory,[Broadcast]/)
$set(_videoSubDirectory,[Video]/)
$set(_otherSubDirectory,[Others]/)
$set(_extDirectory,%_extension%/)


$noop(★ Tribute / Cover Sort Settings [NO VARIOUS] ★)
$set(_altArtistSort,1/)
$set(_liveSubDirectory,[Live]/)
$set(_tributeSubDirectory,[Tribute]/)


$noop(★ COMPILATION DIRECTORY [NO VARIOUS] ★)
$set(_compilationsASubDirectory,Compilation/)
$set(_compilationsGSubDirectory,Compilations/)


$noop(★ SOUNDTRACK/VARIOUS DIRECTORY ★)
$set(_soundTracksDirectory,Soundtrack/)
$set(_variousArtistsDirectory,Various/)
$set(_audiobooksDirectory,Audiobook/)
$set(_incompleteDirectory,Partial)
$set(_podcastSubDirectory,Podcast/)


$noop(★ Other Values Included in Filename ★)
$set(_showRecordLabel,1)
$set(_showTime,1)
$set(_showReleaseType,1)
$set(_showBandwidth,1)
$set(_showCatalogueNumber,1)

$noop(####################### END SETTINGS #######################)

$noop(★ Unless you're changing appearances, there isn't really anything to do past here ★)

$noop(########## DETECT MUSIC TYPE ###############################)

$noop(★ Detect Album ★)
$if($in(%releasetype%,album),
  $set(_isAlbum,1)
)

$noop(★ Detect Single ★)
$if($in(%releasetype%,single),
  $set(_isSingle,1)
)

$noop(★ Detect EP ★)
$if($in(%releasetype%,ep),
  $set(_isEP,1)
)

$noop(★ Detect Broadcast ★)
$if($in(%releasetype%,broadcast),
  $set(_isBroadcast,1)
)

$noop(★ Detect Audiobook ★)
$if($in(%releasetype%,audiobook),  $set(_isAudiobook,1)
)

$noop(★ Detect Other ★)
$if($in(%releasetype%,other),
  $set(_isOther,1)
)

$noop(★ Detect Artist Compilation ★)
$if($in(%releasetype%,compilation),
  $set(_isArtistCompil,1)
)

$noop(★ Detect Live ★)
$if($in(%releasetype%,live),
  $set(_isLive,1)
)

$noop(★ Detect Tribute ★)
$if($in(%albumsort%,Tribute),
  $set(_isTribute,1)
)

$noop(★ Detect Cover ★)
$if($in(%albumsort%,Cover),
  $set(_isCover,1)
)

$noop(★ Detect Podcast ★)
$if($in(%genre%,Podcast),
  $set(_isPodcast,1)
)

$noop(★ Detect Soundtrack ★)
$if($in(%releasetype%,soundtrack),
  $set(_isSoundTrack,1)
)
$noop(★ Detect Incomplete ★)
$if($eq($is_complete(),0),
  $set(_isIncomplete,1)
)

$noop(★ Detect Video ★)
$if($eq($is_video(),0),
  $set(_isVideo,1)
)

$noop(★ Detect Various Artist ★)
$if($eq(%albumartist%,Various Artists),
  $set(_isVarious,1)
)

$noop(★ Re-detect Compilation ★)
$if($eq(%compilation%,1),
  $set(_isGlobalCompil,1)
)
	$if($eq(%_isGlobalCompil%,1), $set(_isArtistCompil,0) )

$noop(★ Get Track Length ★)
$if($eq(%_showTime%,1),
  $noop($set(_trackLength,%length%))
)
$noop(########## TAG MANAGE ######################################)

$noop(★ Organize artist by alphabetical Directorys excluding leading The ★)
$set(albumartist,$if($eq($left(%albumartist%,4),The ),%albumartistsort%,%albumartist%))


$noop(########## TAG CLEANUP  ####################################)

$noop(★ Typography for tags: changes will affect tags on media ★)

$noop(★ ... ➡ …)
$set(album,$replace(%album%,...,…))
$set(title,$replace(%title%,...,…))
$set(discsubtitle,$replace(%discsubtitle%,...,…))

$noop(★ No. ➡ №)
$set(album,$replace(%album%, [Nn]o.\\s*\(\\d\), №\\1))
$set(title,$rreplace(%title%, [Nn]o.\\s*\(\\d\), №\\1))
$set(discsubtitle,$replace(%discsubtitle%, [Nn]o.\\s*\(\\d\), №\\1))

$noop(★ [digit]" ➡ [digit]″)
$set(discsubtitle,$rreplace(%discsubtitle%,\(\\d\)",\\1''))

$noop(★ "12" Vinyl" ➡ "12 Inch Vinyl")
$set(media,$rreplace(%media%,\(\\d\)",\\1 Inch))
$set(album,$rreplace(%album%,\(\\d\)",\\1 Inch))
$set(title,$rreplace(%title%,\(\\d\)",\\1 Inch))

$noop(★ "something" ➡ “something” single quote for server/samba)
$set(albumartist,$rreplace(%albumartist%,"\(.*?\)",'\\1'))
$set(artist,$rreplace(%artist%,"\(.*?\)",'\\1'))
$set(albumartistsort,$rreplace(%albumartistsort%,"\(.*?\)",'\\1'))
$set(artistsort,$rreplace(%artistsort%,"\(.*?\)",'\\1'))
$set(album,$rreplace(%album%,"\(.*?\)",'\\1'))
$set(title,$rreplace(%title%,"\(.*?\)",'\\1'))
$set(discsubtitle,$rreplace(%discsubtitle%,"\(.*?\)",'\\1'))

$noop(★ Typography on file naming only ★)
$set(_titleForFilename,%title%)
$set(_albumForFilename,%album%)
$set(_discsubtitleForFilename,%discsubtitle%)
$set(_albumartistForFilename,%albumartist%)
$set(_artistForFilename,%artist%)
$set(_albumartistsortForFilename,%albumartistsort%)
$set(_artistsortForFilename,%artistsort%)

$noop(★ # ➡ ♯)
$set(_titleForFilename,$replace(%_titleForFilename%,#,♯))
$set(_albumForFilename,$replace(%_albumForFilename%,#,♯))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,#,♯))

$noop(★ ;: ➡ h, m,)
$set(_trackLength,$replace(%_trackLength%,:,m))

$noop(★ : ➡ ∶)
$set(_titleForFilename,$replace(%_titleForFilename%,:,∶))
$set(_albumForFilename,$replace(%_albumForFilename%,:,∶))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,:,∶))
$set(_artistForFilename,$replace(%_artistForFilename%,:,∶))
$set(_albumartistForFilename,$replace(%_albumartistForFilename%,:,∶))
$set(_artistsortForFilename,$replace(%_artistsortForFilename%,:,∶))
$set(_albumartistsortForFilename,$replace(%_albumartistsortForFilename%,:,∶))

$noop(★ ? ➡ ⁇)
$set(_titleForFilename,$replace(%_titleForFilename%,?,⁇))
$set(_albumForFilename,$replace(%_albumForFilename%,?,⁇))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,?,⁇))
$set(_artistForFilename,$replace(%_artistForFilename%,?,⁇))
$set(_artistsortForFilename,$replace(%_artistsortForFilename%,?,⁇))

$set(_titleForFilename,$replace(%_titleForFilename%,|,│))
$set(_albumForFilename,$replace(%_albumForFilename%,|,│))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,|,│))

$set(_titleForFilename,$replace(%_titleForFilename%,>,>))
$set(_albumForFilename,$replace(%_albumForFilename%,>,>))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,>,>))

$set(_titleForFilename,$replace(%_titleForFilename%,<,<))
$set(_albumForFilename,$replace(%_albumForFilename%,<,<))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,<,<))

$set(_titleForFilename,$replace(%_titleForFilename%,*,✱))
$set(_albumForFilename,$replace(%_albumForFilename%,*,✱))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,*,✱))
$set(_artistForFilename,$replace(%_artistForFilename%,*,✱))
$set(_albumartistForFilename,$replace(%_albumartistForFilename%,*,✱))
$set(_artistsortForFilename,$replace(%_artistsortForFilename%,*,✱))
$set(_albumartistsortForFilename,$replace(%_albumartistsortForFilename%,*,✱))

$set(_titleForFilename,$replace(%_titleForFilename%,&,&))
$set(_albumForFilename,$replace(%_albumForFilename%,&,&))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,&,&))
$set(_artistForFilename,$replace(%_artistForFilename%,&,&))
$set(_albumartistForFilename,$replace(%_albumartistForFilename%,&,&))
$set(_artistsortForFilename,$replace(%_artistsortForFilename%,&,&))
$set(_albumartistsortForFilename,$replace(%_albumartistsortForFilename%,&,&))

$noop(★ Pathname Generation Starts Here ★)

$noop(★ Root level Path ★)
$noop(root = 'Destination Directory from above')

$noop(root)
$noop(root)
$noop(root)

$noop(★ Separate Lossy/Lossess types at root directory - Requires plugin ★)

$if($eq(%_rootLossyLess%,1),$if($is_lossless(),%_losslessSubDirectory%,%_lossySubDirectory%/))

$noop(root/Lossy)
$noop(root/Lossless)
$noop(root/Lossy)

$noop(★ Soundtrack in custom directory ,after soundtracksDirectory?? ★)

$noop(root/Lossy/Audio)
$noop(root/Lossy/Soundtracks)
$noop(root/Lossless/Various)
$noop(root/Lossy/Category)

$if(%_isSoundTrack%,%_soundTracksDirectory%,
$if(%_isAudiobook%,%_audiobooksDirectory%)
$if(%_isPodcast%,%_podcastDirectory%)


$noop(★ Various in custom directory ★)
$noop(root/<*>/Various)
$if(%_isVarious%,%_variousArtistsDirectory%,
	$if(%_isGlobalCompil%,%_compilationsGSubDirectory%,)
	$noop(★ Order root by category ★)
	$if($eq(%_orderTypeForRoot%,1),
	$if2(%albumgrouping%,Unknown)
	)/

$noop(★ Order root by artist ★)
$noop(root/<*>/<Last.FM=>/)
$noop(root/<*>/D/)
$if($eq(%_orderTypeForRoot%,2),
	$if($eq(%_orderTypeForArtist%,1),
		$upper($firstalphachar($if2(%_albumartistForFilename%, %_artistForFilename%),#)),
	$if($eq(%_orderTypeForArtist%,2),
		$if(%_isGlobalCompil%,,$upper($firstalphachar($if2(%_albumartistsortForFilename%, %_artistsortForFilename%),#)))
	))
)/

$noop(★ Artist with first letter of first name ★)
$noop(root/<*>/B/The B-52's)
$if($eq(%_orderTypeForArtist%,1),
$if2(%_artistSort%,%_albumartistForFilename%,%_artistForFilename%)
)/

$noop(★ Artist with first letter of last name ★)
$noop(root/<*>/B/B-52's, The)
$if($eq(%_orderTypeForArtist%,2),
$if(%_isGlobalCompil%,,$if2(%_albumartistsortForFilename%,%_artistsortForFilename%))
)/

$noop(★ Using Alternate Artists Directory For Covers & Tributes  **Uses Order for Album Artist tag [Field]★)

	$noop(root/<*>/O/Oingo Boingo/[Tributes]/DeadBandsParty)
	$if($eq_all(%_orderTypeForArtist%,%_isTribute%,1),
	$if2(%_artistSort%,%_albumartistForFilename%,%_artistForFilename%)
	)/

	$noop(root/<*>/D/DEVO/[Covers]/Devolution)
	$if($eq_all(%_orderTypeForArtist%,%_isCover%,1),
	$if2(%_artistSort%,%_albumartistForFilename%,%_artistForFilename%)
	)/

	$noop(★ Organize by type ★)
	$noop(root/<*>/Y/Yes/[Live]/90125 Live)
	$noop(root/<*>/Y/Yes,/90125)
	$if($eq(%_separateByTypeInArtistDirectory%,1),
		$if($eq(%_isArtistCompil%,1),%_compilationsASubDirectory%,
			$if($eq(%_isLive%,1),%_liveSubDirectory%,
				$if($eq(%_isCover%,1),%_coverSubDirectory%,
					$if($eq(%_isTribute%,1),%_tributeSubDirectory%,
						$if($eq(%_isAlbum%,1),
							$if($eq(%_separateAlbum%,1),%_albumSubDirectory%)

							$if($eq(%_isSingle%,1),%_singlesSubDirectory%)
							$if($eq(%_isEP%,1),%_epSubDirectory%)
							$if($eq(%_isBroadcast%,1),%_broadcastSubDirectory%)
							$if($eq(%_isVideo%,1),%_videoSubDirectory%)
							$if($eq(%_isOther%,1),%_otherSubDirectory%)
							)
						)
					)
				)
			)
		)
	)
)

%_albumForFilename%
$noop($if($ne(%media%,CD),$if(%media%,[$rreplace(%media%,["″], Inch)])))
$noop(root/<*>/B/B-52's, The]/Bouncing off the Satellites [Vinyl])
$if($and(%media%,$ne(%media%,CD)), [%media%])
$noop(★ Bouncing off the Satellites [Vinyl] - [YEAR] [Media-Type][CDx~subtitle]/ or /CDx~subtitle/ ★)
$if($if2(%date%,%originalyear%,%originaldate%), [$left($if2(%date%,%originalyear%,%originaldate%),4)] ,[0000])
$noop(★ Bouncing off the Satellites [Vinyl] - [YEAR] [Media-Type][CDx~subtitle]/ or /CDx~subtitle/ [Official] ★)
$if($eq(%_showReleaseType%,1),$title([%releasestatus%]))
$if($eq(%_showCatalogueNumber%,1),$title([%catalognumber%]))
$noop(★ _extraTrackHandling,1 Complete Albums with Extra Tracks are not marked as Partials/Incompletes. Duplicate Tracks will be in a separately named Album Directory at the same Level. ★)
$noop(★ _extraTrackHandling,0 Complete Albums with Extra Tracks are treated as Partials/Incompletes ★)

$noop(★ _incompleteDirectory,1 Specify Partial/Incomplete Album Directory Name. ★)
$noop(★ _incompleteDirectory,0 Do not use a separate Directory for Partials/Incompletes/Overcompletes [Albums with Extra or Missing Tracks] ★)

$if($eq(%_extraTrackHandling%,1),$if($eq($is_complete(),0),$if($lt($matchedtracks( ),%_totalalbumtracks%), - %_incompleteDirectory%)),$if(%_isIncomplete%,- %_incompleteDirectory%,))
$upper(/%_extension%)

$if($gt(%totaldiscs%,1),$noop(
	)$if($lt(%totaldiscs%,10),$set(_discnumber, %discnumber%),$set(_discnumber,$num(%discnumber%,2)))$noop(
	)$if($in(%media%,Vinyl),$noop(
		)$set(_nameForDiscDirectory,@OSLASH@@OBRACKET@%_nameForTypeVinyl%%_discnumber%@CBRACKET@),$noop(
		)$set(_nameForDiscDirectory,@OSLASH@@OBRACKET@%_nameForTypeCD%%_discnumber%@CBRACKET@))$noop(
		)$if($and(%_discsubtitleForFilename%,$eq(%_showDiscSubtitle%,1)),$set(_nameForDiscDirectory,%_nameForDiscDirectory% - %_discsubtitleForFilename%))$noop(
		)$if($eq(%_useSubDiscDirectory%,1),$noop(
			)$set(_nameForDiscDirectory,$replace(%_nameForDiscDirectory%,@OSLASH@@OBRACKET@,/))$noop(
			)$set(_nameForDiscDirectory,$replace(%_nameForDiscDirectory%,@CBRACKET@,)),$noop(
			)$if($eq(%_mergeDiscWhenNotUsingSubDirectory%,1),$noop(
				)$unset(_nameForDiscDirectory),$noop(
				)$set(_nameForDiscDirectory,$replace(%_nameForDiscDirectory%,@OSLASH@@OBRACKET@,[))$noop(
			)$set(_nameForDiscDirectory,$replace(%_nameForDiscDirectory%,@CBRACKET@,]))$noop(
		))$noop(
	))$noop(
)$if(%_nameForDiscDirectory%,%_nameForDiscDirectory%))$if(%_showRecordLabel%, [%label%])/


$noop(Bitrate factors of 8.0 are CBR, Anything else is VBR)
$set(BRType,$if($eq_any(%bitrate%,320.0,256.0,224.0,192.0,160.0,128.0,112.0,96.0,80.0,64.0,56.0,48.0,40.0,32.0,24.0,16.0,8.0),CBR,VBR))
$noop(If it's VBR, What is the bitrate?)
$if($eq(%BRType%,VBR),$if($gte($left(%bitrate%,4),999),$set(%BrVBR%,$left(%bitrate%,4)),$set(%BrVBR%,$left(%bitrate%,3))))
$if($eq(%BRType%,CBR),
$if($eq(%bitrate%,320.0),$set(_filebr,320K),
$if($eq(%bitrate%,256.0),$set(_filebr,256K),
$if($eq(%bitrate%,224.0),$set(_filebr,224K),
$if($eq(%bitrate%,192.0),$set(_filebr,192K),
$if($eq(%bitrate%,160.0),$set(_filebr,160K),
$if($eq(%bitrate%,128.0),$set(_filebr,128K),
$if($eq(%bitrate%,112.0),$set(_filebr,112K),
$if($eq(%bitrate%,96.0),$set(_filebr,96K),
$if($eq(%bitrate%,80.0),$set(_filebr,80K),
$if($eq(%bitrate%,64.0),$set(_filebr,64K),
$if($eq(%bitrate%,56.0),$set(_filebr,56K),
$if($eq(%bitrate%,48.0),$set(_filebr,48K),
$if($eq(%bitrate%,40.0),$set(_filebr,40K),
$if($eq(%bitrate%,32.0),$set(_filebr,32K),
$if($eq(%bitrate%,24.0),$set(_filebr,24K),
$if($eq(%bitrate%,16.0),$set(_filebr,16K),
$if($eq(%bitrate%,8.0),$set(_filebr,8),
										))))))))))))))))))
$if($eq(%BRType%,VBR),
$if(%_filebr%,,
$if($gte(%BrVBR%,320),$set(_filebr, B 320),
$if($lt(%BrVBR%,220),$set(_filebr, V0),
$if($lt(%BrVBR%,190),$set(_filebr, V1),
$if($lt(%BrVBR%,170),$set(_filebr, V2),
$if($lt(%BrVBR%,150),$set(_filebr, V3),
$if($lt(%BrVBR%,140),$set(_filebr, V4),
$if($lt(%BrVBR%,130),$set(_filebr, V5),
$if($lt(%BrVBR%,120),$set(_filebr, V6),
))))))))))
$noop(★ Track. Title --%_filebr% -- %bitrate% -- %BRType% -- %BrVBR% --  ★)  
$if($in(%media%,Vinyl),$noop(
	)$if($eq(%_useMusicBrainzStyleForVinylTrack%,1),$noop(
		)$if(%_musicbrainz_tracknumber%,%_musicbrainz_tracknumber%. )$noop(
	)),$noop(
	)$if(%tracknumber%,$if($gt(%totaldiscs%,1),$if($and($eq(%_useSubDiscDirectory%,0),$eq(%_mergeDiscWhenNotUsingSubDirectory%,1)),%discnumber%))$num(%tracknumber%,2). ))
$noop(★ GAME OVER ★)
%_titleForFilename% 
$if($eq(%_showTime%,1),[%_length%])
$if($eq(%_showBandwidth%,1),[%_filebr%$left(%_bitrate%,3) %_sample_rate%KHz %BRType% %BrVBR%%_channels%ch])  

$noop(★ 00 CREDITS ★)

4 Likes

@Here4Pizza, can you give the code for your layout above please?

This is a fantastic pattern @tdiaz, thanks for publishing it! How would you go about to add the catalogue number to the most peripheral (the “last” one per album) folder?

Do you mean appending it to the album directory or one higher that contains the albums within? That may be the artist named directory, or the subdirectories for file type within the artist directory?

Volume/Music Sorted/B/B-52’s, The/M4A//Bouncing Across the Satellites/01. Track…
/Volume/Music Sorted/B/B-52’s, The/M4A/[catalogue]/Bouncing Across the Satellites [catalogue]/01. Track…

Either way, it’s going to be a scriptmtag droppd in the build process. One would hope there is never a reason for separate catalog numbers per track within an album.

That would be awkward to say the least. But nothing surprises me anymore. :sunglasses:

Hmm, I guess it would make most sense at the album level, so that this would be a great way of separate different pressings/versions of the same album. I’m actually not someone who has lot of these, but I have at least some old Aerosmith records on both vinyl and CD that I’d love to separate.
Anyway, thanks for a great script!

I updated it again. It’s got the Catalogue Number in it, too.

Pretty much every option is turned on, the configurations are all in the first section. You shouldn’t have to mess with the rest unless you want to move something around. I need to update the ‘sample paths’ in there, and a little bit more. I’m sick of looking at this thing right now. :wink:

OTOH, between that and the mods on the backside, I’ve got Picard doing all this anal sorting and labeling that I wanted.

Like I said previously, the target for this script is to put everything of the same name near each other, separated by file formats and to make handling things like duplicate tracks and such still give you a ‘perfect’ set of the album, and push the rest next to it.

Albums with too many tracks are no longer treated as incomplete.

So the only time you’ll see a ‘partial/incomplete’ marked directory is when you don’t have a complete one already. Any added incremental directories of that album themselves do -NOT- have a complete set will -NOT- be marked as incomplete because you already have a complete set.

/Volume/Drive/Music/O/Oingo Boingo/Only a Lad [1981]/ <-- the complete one.
/Volume/Drive/Music/O/Oingo Boingo/Only a Lad [1981] (1)/ <-- Any Duplicates End up here…
/Volume/Drive/Music/O/Oingo Boingo/Only a Lad [1981] (2)/ <-- and here if there’s more than one duplicate of something. It will just roll to the next incremental directory.

I’ll post another in a new post, with a new screen shot example, and the comments/instructions/examples in the script with more details.

4 Likes

Absolutely fantastic, thanks @tdiaz!

MBP YA Magic-Script that does more stuff too - v2.0a .

Now Glutin Free!

This script is setup with more of an overall archival sorting method in mind, from which you can then choose titles by file format directories for your various devices.

e.g.: The name of the Album can be specified at the File Format level, so you don’t have to rename something when you drop it wherever while assembling a library for a specific device, only needing to copy specific stuff to the target location, etc…

You certainly could aim your favorite player/playback method at the Directory Tree created, though most I’m sure will have duplicate entries when there are extra files/formats available at the individual release / Album level.

This can work with the official release of Picard, however the handling of duplicate tracks, whole albums, etc., will not be by seperate directories unless you roll your own build with the modification referenced in a previous post. This would also affect the duplicate albums with too many tracks, where they will still all be placed in the same directory as opposed to be separated. Though the directory will still not be marked ‘Incomplete’, as there is -at least- a full album within it.

• Albums, Singles, EP, Live, Compilations, etc. Separated within the Artists directory.

• Albums with too many tracks will not be marked as incomplete and will be handled the same as a complete album.

• Separate Root directory for compilations with option for single artist compilations to be placed with the artist instead of compilations.

~/MusicRoot/[O]/Oingo Boingo/[Artist Compilations]/

Root directory Audio Books, Podcasts, Others

~/MusicRoot/Compilations/K-Tel Hits of the 1980s Vol. 1
~/MusicRoot/Audio Books/Ready Player One
~/MusicRoot/Podcasts/Mad Mad Music #29

Optional handling for Cover / Tribute releases. Place them within a specified Artist subdirectory.

$noop(★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★)
$noop(★ MBP YA Magic-Script that does more stuff too. - v2.1a - amd/17500mph ★)
$noop(★                                                                      ★)
$noop(★ Here is a script for music renaming in MusicBrainz Picard            ★)
$noop(★                                                                      ★)
$noop(★ Features :                                                           ★)
$noop(★                                                                      ★)
$noop(★   Individualy Selectable Root Directory Organization Options:        ★)
$noop(★                                                                      ★)
$noop(★ • Directories by [A]rtist Name / [N]ame, Artist or last.fm** category★)
$noop(★ • subDirectory for each main type [Album/Single/EP...]               ★)
$noop(★ • Separate Root directory for compilations [!various]                ★)
$noop(★ • Single Artist Compilations go in Artist Directory                  ★)
$noop(★ • Root directory Audio Books, Podcasts, Others                       ★)
$noop(★                                                                      ★)
$noop(★  ~/MusicRoot/[O]/Oingo Boingo/[Artist Compilations]/                 ★)
$noop(★  ~/MusicRoot/Compilations/K-Tel Hits of the 1980s Vol. 1             ★)
$noop(★  ~/MusicRoot/Audio Books/Ready Player One                            ★)
$noop(★  ~/MusicRoot/Podcasts/Mad Mad Music #29                              ★)
$noop(★                                                                      ★)
$noop(★ - Alphabetize artist without leading "The"                           ★)
$noop(★ - Show Album Release Status on Album Directory                       ★)
$noop(★ - Show Record Label on Directory Name Directory                      ★)
$noop(★ - Show Catalogue Number in Album Directory Name                      ★)
$noop(★ - Show Track Duration in Filename                                    ★)
$noop(★ - Filtered character for files & directory naming                    ★)
$noop(★ - Include media type in directory name [when its not CD]             ★)
$noop(★ - Multi-Disc SubDirectory per Disc in Album Directory                ★)
$noop(★ - Custom directory tag for multi-disc CD/Vinyl [CD1/Disc1 by default]★)
$noop(★ - Put multi-CD release in same directory [names become 101/102/201..]★)
$noop(★ - Vinyl can use musicbrainz style for track [A1/A2/B1...]            ★)
$noop(★ - File Type SubDirectory in Album Directory                          ★)
$noop(★                                                                      ★)
$noop(★ ** Optional Plugin Needed for Last.fm [for category trending]        ★)
$noop(★   -> https://github.com/fdemmer/Picard-Last.fm.ng-Plugin             ★)
$noop(★                                                                      ★)
$noop(★ - DevMode:                                                           ★)
$noop(★   Allows better simulation control of variables for debugging        ★)
$noop(★                                                                      ★)
$noop(★ Do Not Taunt The Happy Tagging Ball                                  ★)
$noop(★                                                                      ★)
$noop(★----------------------------------------------------------------------★)
$noop(★   Based on the MBP Magic Script  By Ski-lleR                         ★)
$noop(★   Thanks to avibrazil for his filter                                 ★)
$noop(★ > https://github.com/avibrazil/picard-scripting                      ★)
$noop(★----------------------------------------------------------------------★)
$noop(★                                                                      ★)
$noop(★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★)
$noop(★ INSERT COIN ★)

$noop(Configuration Section - 0-Disable / 1-Enable)

$noop(★ GLOBAL ★)

$noop(★ Sort orderTypeForRoot ★)
$noop(★ ~/Music/Last.fm Genre/A/Artist/AlbumTitle/ ★)
$noop(★  1: Category [Last.fm.ng] ★)
$noop(★ ~/Music/A/Artist/AlbumTitle/ ★)
$noop(★  2: Artist first letter ★)
$set(_orderTypeForRoot,2)


$noop(★ Sort orderTypeForArtist ★)
$noop(★  1: First letter of first name ★)
$noop(★ ~/Music/M/Music Artist/AlbumTitle/  ★)
$noop(★  2: First letter of last name ★)
$noop(★ ~/Music/A/Artist, Music/AlbumTitle/  ★)
$set(_orderTypeForArtist,2)

$noop(★ How to designate Complete Albums that contain multiples of at least 1 Track 1 ★)
$noop(★ 0, They are Handled as InComplete ★)
$noop(★ 1  They are Handled as Complete w/starred but not Gold icon★)
$set(_extraTrackHandling,1)


$noop(★ 1  Earlier in the Sort Artist Diversion?★)
$set(_earlierLevelArtistSeparation,0)
$noop(★ 0  Earlier in the Sort Incomplete Diversion?★)
$set(_earlierPresortForIncompletes,1)

$noop(★ Do you want separation by type / extension at the Root Level? ★)
$noop(★ ~/Music/MP3/AlbumTitle/ - ~/Music/FLAC/AlbumTitle/ - ~/Music/M4A/AlbumTitle/ - ~/Music/WNA/AlbumTitle/ ★)
$set(_rootLevelTypeSeparation,0)

$noop(★ Do you want separatation by type / extension at the Album Level? ★)
$noop(★ ~/Music/AlbumTitle/MP3/ - ~/Music/AlbumTitle/FLAC/ - ~/Music/AlbumTitle/M4A - ~/Music/AlbumTitle/WNA/ ★)
$set(_albumLevelTypeSeparation,1)

$noop(★ Do you want the Album Title added before the type / extension after the Album Level? ★)
$noop(★ ~/Music/AlbumTitle/AlbumTitle MP3/ - ~/Music/AlbumTitle/AlbumTitle FLAC/ - ~/Music/AlbumTitleAlbumTitle /M4A ★)
$set(_albumNameAtTypeSeparation,1)

$noop(Album Name/EP/Single/Live/Album etc.)
$noop(★ ~/Music/AlbumTitle/AlbumTitle MP3/Single/ - ~/Music/AlbumTitle/AlbumTitle FLAC/EP/ ★)
$set(_separateByTypeInArtistDirectory,1)

$noop(★ Do you want Tribute and Cover Albums Placed with Artist being attributed? ★)
$noop(★ ~/Music/AlbumTitle/AlbumTitle MP3/Cover/ - ~/Music/AlbumTitle/AlbumTitle FLAC/Tribute/ ★)
$noop(★ Requires Custom Use of AlbumArtistSort and ArtistSort Tags ★)
$noop(Enter “Tribute” or “Cover” in the Album Sort as field.)
$noop(Enter the Artist in the Album Artist Sort as field.)
$set(_altArtistSort,1/)

$set(_separateAlbum,0) $noop(Albums in SubDirectory as well)
$noop(★ ~/Music/A/Artist, Music/Album/AlbumTitle ★)

$set(_compilationsGSubDirectory,Compilations/)
$noop(★ ~/Music/Compilations/  ★)

$noop(★ SOUNDTRACK/VARIOUS DIRECTORY ★)
$set(_soundTracksDirectory,Soundtrack/)
$set(_variousArtistsDirectory,Various/)
$set(_audiobooksDirectory,Audiobook/)
$set(_incompleteDirectory,Partial)
$set(_podcastSubDirectory,Podcast/)

$noop(★ Multi-Disc ★)

$noop(★ ~/Music/A/Artist, Music/AlbumTitle/Disc01/01 - Tracklist ★)
$set(_useSubDiscDirectory,1)

$noop(★ ~/Music/A/Artist, Music/AlbumTitle/01 - Tracklist ***SKIP SubDiscDirectory if only one Medium in Realease ★)
$set(_mergeDiscWhenNotUsingSubDirectory,0)

$set(_showDiscSubtitle,1)
$set(_nameForTypeCD,Disc)
$set(_nameForTypeVinyl,Side)

$noop(★ ~/Music/A/Artist, Music/AlbumTitle/A1 ,A2 ,B1, B2 Tracklist - ★)
$set(_useMusicBrainzStyleForVinylTrack,1)

$noop(★ Custom Subdirectory Titles at Artist Level ★)
$noop(★ ~/Music/A/Artist, Music/EP/AlbumTitle ~/Music/A/Artist, Music/Live/AlbumTitle ★)


$set(_albumSubDirectory,Album/)
$set(_compilationsASubDirectory,Compilation/)
$set(_coverSubDirectory,[Cover]/)
$set(_tributeSubDirectory,[Tribute]/)
$set(_singlesSubDirectory,[Single]/)
$set(_liveSubDirectory,[Live]/)
$set(_epSubDirectory,[EP]/)
$set(_broadcastSubDirectory,[Broadcast]/)
$set(_videoSubDirectory,[Video]/)
$set(_otherSubDirectory,[Others]/)
$set(_extDirectory,%_extension%/)

$noop(★ Other Values Included in Filename ★)
$set(_showRecordLabel,1)
$set(_showTime,1)
$set(_showDate,1)
$set(_showReleaseStatus,1)
$set(_showBandwidth,1)
$set(_showCatalogueNumber,1)

$noop(★ For Development Only - Variable Settings in Subsections ★)
$noop(★ Where Available - Audio Metrics Only at this Time ★)
$set(_devMode,0)
$noop(####################### Scratch Space ######################)
$noop( )
$noop(####################### END SETTINGS #######################)

$noop(★ Unless you're changing appearances, there isn't really anything to do past here ★)

$noop(########## DETECT MUSIC TYPE ###############################)

$noop(★ Detect Album ★)
$if($in(%releasetype%,album),
  $set(_isAlbum,1)
)
$noop(★ Detect Single ★)
$if($in(%releasetype%,single),
  $set(_isSingle,1)
)
$noop(★ Detect Live ★)
$if($in(%releasetype%,live),
  $set(_isLive,1)
)
$noop(★ Detect EP ★)
$if($in(%releasetype%,ep),
  $set(_isEP,1)
)
$noop(★ Detect Broadcast ★)
$if($in(%releasetype%,broadcast),
  $set(_isBroadcast,1)
)
$noop(★ Detect Artist Compilation ★)
$if($in(%releasetype%,compilation),
  $set(_isArtistCompil,1)
)
$noop(★ Detect Audiobook ★)
$if($in(%releasetype%,audiobook),  $set(_isAudiobook,1)
)
$noop(★ Detect Other ★)
$if($in(%releasetype%,other),
  $set(_isOther,1)
)
$noop(★ Detect Tribute ★)
$if($in(%albumsort%,Tribute),
  $set(_isTribute,1)
)
$noop(★ Detect Cover ★)
$if($in(%albumsort%,Cover),
  $set(_isCover,1)
)
$noop(★ Detect Podcast ★)
$if($in(%genre%,Podcast),
  $set(_isPodcast,1)
)
$noop(★ Detect Soundtrack ★)
$if($in(%releasetype%,soundtrack),
  $set(_isSoundTrack,1)
)
$noop(★ Detect Incomplete ★)
$if($eq($is_complete(),0),
  $set(_isIncomplete,1)
)
$noop(★ Detect Video ★)
$if($eq($is_video(),0),
  $set(_isVideo,1)
)
$noop(★ Detect Various Artist ★)
$if($eq(%albumartist%,Various Artists),
  $set(_isVarious,1)
)
$noop(★ Re-detect Compilation Type ★)
$if($eq(%compilation%,1),
  $set(_isGlobalCompil,1)
)
$noop(★ Detect Global Compilation ★)
$if($eq(%_isGlobalCompil%,1), $set(_isArtistCompil,0)
)

$noop(★ Get Track Length ★)
$if($eq(%_showTime%,1),
$noop($set(_trackLength,%length%))
)
$noop(########## Start TAG Manipulation ##########################)
$noop(★ Organize artist by alphabetical Directories excluding leading The ★)
$set(albumartist,$if($eq($left(%albumartist%,4),The ),%albumartistsort%,%albumartist%))
$set(_originalFileName,%_filename%)

$noop(########## Start TAG Formatting  ###########################)
$noop(★ Typography for tags: changes will affect tags on media ★)

$noop(★ ... ➡ …)
$set(album,$replace(%album%,...,…))
$set(title,$replace(%title%,...,…))
$set(discsubtitle,$replace(%discsubtitle%,...,…))

$noop(★ No. ➡ №)
$set(album,$replace(%album%, [Nn]o.\\s*\(\\d\), №\\1))
$set(title,$rreplace(%title%, [Nn]o.\\s*\(\\d\), №\\1))
$set(discsubtitle,$replace(%discsubtitle%, [Nn]o.\\s*\(\\d\), №\\1))

$noop(★ [digit]" ➡ [digit]″)
$set(discsubtitle,$rreplace(%discsubtitle%,\(\\d\)",\\1''))

$noop(★ "12" Vinyl" ➡ "12 Inch Vinyl")
$set(media,$rreplace(%media%,\(\\d\)",\\1 Inch))
$set(album,$rreplace(%album%,\(\\d\)",\\1 Inch))
$set(title,$rreplace(%title%,\(\\d\)",\\1 Inch))

$noop(★ "something" ➡ “something” single quote for server/samba)
$set(albumartist,$rreplace(%albumartist%,"\(.*?\)",'\\1'))
$set(artist,$rreplace(%artist%,"\(.*?\)",'\\1'))
$set(albumartistsort,$rreplace(%albumartistsort%,"\(.*?\)",'\\1'))
$set(artistsort,$rreplace(%artistsort%,"\(.*?\)",'\\1'))
$set(album,$rreplace(%album%,"\(.*?\)",'\\1'))
$set(title,$rreplace(%title%,"\(.*?\)",'\\1'))
$set(discsubtitle,$rreplace(%discsubtitle%,"\(.*?\)",'\\1'))

$noop(########## Start File Naming Structure Variables ###########)

$noop(★ Typography on file naming only ★)
$set(_titleForFilename,%title%)
$set(_albumForFilename,%album%)
$set(_discsubtitleForFilename,%discsubtitle%)
$set(_albumartistForFilename,%albumartist%)
$set(_artistForFilename,%artist%)
$set(_albumartistsortForFilename,%albumartistsort%)
$set(_artistsortForFilename,%artistsort%)

$noop(★ # ➡ ♯)
$set(_titleForFilename,$replace(%_titleForFilename%,#,♯))
$set(_albumForFilename,$replace(%_albumForFilename%,#,♯))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,#,♯))

$noop(★ ;: ➡ h, m,)
$set(_trackLength,$replace(%_trackLength%,:,m))

$noop(★ : ➡ ∶)
$set(_titleForFilename,$replace(%_titleForFilename%,:,∶))
$set(_albumForFilename,$replace(%_albumForFilename%,:,∶))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,:,∶))
$set(_artistForFilename,$replace(%_artistForFilename%,:,∶))
$set(_albumartistForFilename,$replace(%_albumartistForFilename%,:,∶))
$set(_artistsortForFilename,$replace(%_artistsortForFilename%,:,∶))
$set(_albumartistsortForFilename,$replace(%_albumartistsortForFilename%,:,∶))

$noop(★ ? ➡ ⁇)
$set(_titleForFilename,$replace(%_titleForFilename%,?,⁇))
$set(_albumForFilename,$replace(%_albumForFilename%,?,⁇))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,?,⁇))
$set(_artistForFilename,$replace(%_artistForFilename%,?,⁇))
$set(_artistsortForFilename,$replace(%_artistsortForFilename%,?,⁇))

$set(_titleForFilename,$replace(%_titleForFilename%,|,│))
$set(_albumForFilename,$replace(%_albumForFilename%,|,│))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,|,│))

$set(_titleForFilename,$replace(%_titleForFilename%,>,>))
$set(_albumForFilename,$replace(%_albumForFilename%,>,>))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,>,>))

$set(_titleForFilename,$replace(%_titleForFilename%,<,<))
$set(_albumForFilename,$replace(%_albumForFilename%,<,<))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,<,<))

$set(_titleForFilename,$replace(%_titleForFilename%,*,✱))
$set(_albumForFilename,$replace(%_albumForFilename%,*,✱))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,*,✱))
$set(_artistForFilename,$replace(%_artistForFilename%,*,✱))
$set(_albumartistForFilename,$replace(%_albumartistForFilename%,*,✱))
$set(_artistsortForFilename,$replace(%_artistsortForFilename%,*,✱))
$set(_albumartistsortForFilename,$replace(%_albumartistsortForFilename%,*,✱))

$set(_titleForFilename,$replace(%_titleForFilename%,&,&))
$set(_albumForFilename,$replace(%_albumForFilename%,&,&))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,&,&))
$set(_artistForFilename,$replace(%_artistForFilename%,&,&))
$set(_albumartistForFilename,$replace(%_albumartistForFilename%,&,&))
$set(_artistsortForFilename,$replace(%_artistsortForFilename%,&,&))
$set(_albumartistsortForFilename,$replace(%_albumartistsortForFilename%,&,&))
$noop(★ For Development Only - Variable Settings in Subsections ★)
$noop(★ Where Available - Audio Metrics Only at this Time ★)

$noop(########### Audio Metrics Setup  ###########################)
$noop(########### DevMode Values Only ############################)

$set(_devMode,0) $noop(This one is here for convenience, for now this works here, too. But it will need to go later.)

$set(_biitrate,192)
$set(_saample_rate,44100)
$set(_biits_per_sample,16)
$set(_chaannels,2)
$set(_tiitle,My Great Score)
$noop(########### CONFIRM DevMode is Disabled for Live Use ########)
$noop({%title% - %_bitrate% - %_sample_rate% - %_bits_per_sample% - %_channels%})

$if($eq(%_devMode%,1),$set(_bitRateValue,$left(%_biitrate%,3)),$set(_bitRateValue,$left(%_bitrate%,3)))
$if($eq(%_devMode%,1),$set(_bitRateSpeed,%_saample_rate%KHz),$set(_bitRateSpeed,%_sample_rate%KHz ))
$if($eq(%_devMode%,1),$set(_bitsPerSample,[%_biits_per_sample%]bit),$set(_bitsPerSample,[%_bits_per_sample%]bit ))
$if($eq(%_devMode%,1),$set(_audioChannels,%_chaannels%ch]),$set(_audioChannels,%_channels%ch]))
$if($eq(%_devMode%,1),$set(_titleForFilename,%title%),$set(_titleForFilename,%title%))

$noop({%title% - %_bitRateValue% - %_bitRateSpeed% - %_bitsPerSample% - %_audioChannels% - %_titleForFilename% - %_fileCBRRate% - %_fileVBRRate% -  %_bitrate% - %_biitrate%})

$noop(Bitrate factors of 8.0 are CBR, Anything else is VBR)

$set(_bitRateType,$if($eq_any(%_bitRateValue%,320,256,224,192,160,128,112,96,80,64,56,48,40,32,24,16,8),CBR $set(_cbrRateValue,%_bitRateValue%),VBR $set(_vbrRateValue,%_bitRateValue%)))

$noop(Bitrate factors of 8.0 are most likely CBR with the remainder being VBR)

$if($eq(%_cbrRateValue%,320),$set(_fileCBRRate,320 ),
$if($eq(%_cbrRateValue%,256),$set(_fileCBRRate,256 ),
$if($eq(%_cbrRateValue%,224),$set(_fileCBRRate,224 ),
$if($eq(%_cbrRateValue%,192),$set(_fileCBRRate,192 ),
$if($eq(%_cbrRateValue%,160),$set(_fileCBRRate,160 ),
$if($eq(%_cbrRateValue%,128),$set(_fileCBRRate,128 ),
$if($eq(%_cbrRateValue%,112),$set(_fileCBRRate,112 ),
$if($eq(%_cbrRateValue%,96),$set(_fileCBRRate,96 ),
$if($eq(%_cbrRateValue%,80),$set(_fileCBRRate,80 ),
$if($eq(%_cbrRateValue%,64),$set(_fileCBRRate,64 ),
$if($eq(%_cbrRateValue%,56),$set(_fileCBRRate,56 ),
$if($eq(%_cbrRateValue%,48),$set(_fileCBRRate,48 ),
$if($eq(%_cbrRateValue%,40),$set(_fileCBRRate,40 ),
$if($eq(%_cbrRateValue%,32),$set(_fileCBRRate,32 ),
$if($eq(%_cbrRateValue%,24),$set(_fileCBRRate,24 ),
$if($eq(%_cbrRateValue%,16),$set(_fileCBRRate,16 ),
$if($eq(%_cbrRateValue%,8),$set(_fileCBRRate,8 ),
										      )))))))))))))))))

$if($eq(%_bitRateType%,VBR)$set(_fileVBRRate,%_vbrRateValue% ) ,
$if($gt(%_vbrRateValue%,319),$set(_fileVBRRate,320+ ),
$if($gt(%_vbrRateValue%,220),$set(_fileVBRRate,V0 ),
$if($gt(%_vbrRateValue%,191),$set(_fileVBRRate,V1 ),
$if($gt(%_vbrRateValue%,170),$set(_fileVBRRate,V2 ),
$if($gt(%_vbrRateValue%,150),$set(_fileVBRRate,V3 ),
$if($gt(%_vbrRateValue%,140),$set(_fileVBRRate,V4 ),
$if($gt(%_vbrRateValue%,130),$set(_fileVBRRate,V5 ),
$if($gt(%_vbrRateValue%,120),$set(_fileVBRRate,V6 ),
												)))))))))
$noop(######### File Naming Structure Variables Complete #########)



$noop(★ Pathname Generation Starts Here ★)

$noop(★ Root level Path ★)
$noop(   root = '/Volumes/Drive/Music/ ... [Destination Directory Setting])


$noop(★ Separate by Format at root directory ★)
$noop(   rootLevelPath/MP3/Artist/Album ...)
$if($eq(%_rootLevelTypeSeparation%,1),$upper(%_extension%),)

$noop(   Earlier Incomplete Separation for Sorting ...)
$if($eq(%_earlierPresortForIncompletes%,1),$if($eq($is_complete(),0),$if($lt($matchedtracks(),%_totalalbumtracks%),# - %_incompleteDirectory%)),$if(%_isIncomplete%,# - %_incompleteDirectory%,))/
$if($eq(%_earlierLevelArtistSeparation%,1),%_artistForFilename%/)

$noop(★ Soundtrack in custom directory ,after soundtracksDirectory?? ★)
$noop(   root/*/Audio Books/Title ...)
$noop(   root/*/Soundtracks/Title ...)
$noop(   root/*/Podcasts/Title ...)
$if(%_isSoundTrack%,%_soundTracksDirectory%$left($swapprefix(%album%,A,An,The),1)/,/
$if(%_isAudiobook%,%_audiobooksDirectory%$left($swapprefix(%album%,A,An,The),1)/,/)
$if(%_isPodcast%,%_podcastDirectory%$left($swapprefix(%album%,A,An,The),1)/,/)

$noop(★ Various in custom directory ★)
$noop(root/<*>/Various)
$if(%_isVarious%,%_variousArtistsDirectory%$left($swapprefix(%album%,A,An,The),1)/,/
	$if(%_isGlobalCompil%,%_compilationsGSubDirectory%$left($swapprefix(%album%,A,An,The),1)/,/)
	$noop(★ Order root by category ★)
	$if($eq(%_orderTypeForRoot%,1),
	$if2(%albumgrouping%,Unknown)
	)/

$noop(★ Order root by artist ★)
$noop(root/<*>/<Last.FM=>/)
$noop(root/<*>/D/)
$if($eq(%_orderTypeForRoot%,2),
	$if($eq(%_orderTypeForArtist%,1),
		$upper($firstalphachar($if2(%_albumartistForFilename%, %_artistForFilename%),#)),
	$if($eq(%_orderTypeForArtist%,2),
		$if(%_isGlobalCompil%,,$upper($firstalphachar($if2(%_albumartistsortForFilename%, %_artistsortForFilename%),#)))
	))
)/

$noop(★ Artist with first letter of first name ★)
$noop(root/<*>/B/The B-52's)
$if($eq(%_orderTypeForArtist%,1),
$if2(%_artistSort%,%_albumartistForFilename%,%_artistForFilename%)
)/

$noop(★ Artist with first letter of last name ★)
$noop(root/<*>/B/B-52's, The)
$if($eq(%_orderTypeForArtist%,2),
$if(%_isGlobalCompil%,,$if2(%_albumartistsortForFilename%,%_artistsortForFilename%))
)/


$noop(★ Using Alternate Artists Directory For Covers & Tributes  **Uses Order for Album Artist tag [Field]★)

	$noop(root/<*>/O/Oingo Boingo/[Tributes]/DeadBandsParty)
	$if($eq_all(%_orderTypeForArtist%,%_isTribute%,1),
	$if2(%_artistSort%,%_albumartistForFilename%,%_artistForFilename%)
	)/

	$noop(root/<*>/D/DEVO/[Covers]/Devolution)
	$if($eq_all(%_orderTypeForArtist%,%_isCover%,1),
	$if2(%_artistSort%,%_albumartistForFilename%,%_artistForFilename%)
	)/
	$noop(★ Organize by type ★)
	$noop(root/<*>/Y/Yes/[Live]/90125 Live)
	$noop(root/<*>/Y/Yes,/90125)
	$if($eq(%_separateByTypeInArtistDirectory%,1),
		$if($eq(%_isArtistCompil%,1),%_compilationsASubDirectory%,
			$if($eq(%_isLive%,1),%_liveSubDirectory%,
				$if($eq(%_isCover%,1),%_coverSubDirectory%,
					$if($eq(%_isTribute%,1),%_tributeSubDirectory%,
						$if($eq(%_isEP%,1),%_epSubDirectory%,
							$if($eq(%_isSingle%,1),%_singlesSubDirectory%,
								$if($eq(%_isBroadcast%,1),%_broadcastSubDirectory%,
									$if($eq(%_isVideo%,1),%_videoSubDirectory%,
										$if($eq(%_isOther%,1),%_otherSubDirectory%,
											$if($eq(%_isAlbum%,1),
											$if($eq(%_separateAlbum%,1),%_albumSubDirectory%))

											))))))))))))

$noop(root/<*>/B/B-52's, The]/Bouncing off the Satellites/ )
%_albumForFilename%
$noop(★ Bouncing off the Satellites [Media-Type]/ ★)
$noop($if($ne(%media%,CD),$if(%media%,[$rreplace(%media%,["″], Inch)])))
$if(%media%, [$title(%media%]),)

$noop($if($and(%media%,$ne(%media%,CD)),$if($in(%media%,Vinyl),$title( [%media%])),$upper( [%media%])))

$noop(★ Bouncing off the Satellites [Vinyl] [YEAR]/ ★)
$if($eq(%_showDate%,1),$if($if2(%date%,%originalyear%,%originaldate%), [$left($if2(%date%,%originalyear%,%originaldate%),4)], [0000]))
$noop(★ Bouncing off the Satellites [Vinyl] [1986] [Release Status]/ ★)
$if(%releasestatus%,$if($eq(%_showReleaseStatus%,1),$title( [%releasestatus%])))

$noop(★ Bouncing off the Satellites [Vinyl] [1986] [Official] [Label]/ ★)
$if(%label%,$if(%_showRecordLabel%, $if(%label%,$title([%label%]))))

$noop(★ Bouncing off the Satellites [Vinyl] [1986] [Official] [MCA] [CAT-Number]/ ★)
$if(%catalognumber%,$if($eq(%_showCatalogueNumber%,1),$title( [%catalognumber%])))

$noop(★ Bouncing off the Satellites [Vinyl] [1986] [Official] [MCA] [AB-DC001]/ ★)
$noop(★ Bouncing off the Satellites [Vinyl] [1986] [Official] [MCA] [AB-DC001] - Incomplete/ ★)
$if($eq(%_extraTrackHandling%,1),$if($eq($is_complete(),0),$if($lt($matchedtracks( ),%_totalalbumtracks%), - %_incompleteDirectory%)),$if(%_isIncomplete%, - %_incompleteDirectory%,))/

$noop(★ Bouncing off the Satellites [Vinyl] [1986] [Official] [MCA] [AB-DC001]/ MP3 / ★)
$noop(★ Bouncing off the Satellites [Vinyl] [1986] [Official] [MCA] [AB-DC001]/ Bouncing off the Satellites MP3 / ★)
$if($eq(%_albumLevelTypeSeparation%,1),$if($eq(%_albumNameAtTypeSeparation%,1),%_albumForFilename% ,)$upper(%_extension%))/

$noop(★ Bouncing off the Satellites [Vinyl] [1986] [Official] [MCA] [AB-DC001]/ .../ Disc # ★)
$if($gt(%totaldiscs%,1),$noop(
	)$if($lt(%totaldiscs%,10),$set(_discnumber, %discnumber%),$set(_discnumber,$num(%discnumber%,2)))$noop(
	)$if($in(%media%,Vinyl),$noop(
		)$set(_nameForDiscDirectory,@OSLASH@@OBRACKET@%_nameForTypeVinyl%%_discnumber%@CBRACKET@),$noop(
		)$set(_nameForDiscDirectory,@OSLASH@@OBRACKET@%_nameForTypeCD%%_discnumber%@CBRACKET@))$noop(
		)$if($and(%_discsubtitleForFilename%,$eq(%_showDiscSubtitle%,1)),$set(_nameForDiscDirectory,%_nameForDiscDirectory% - %_discsubtitleForFilename%))$noop(
		)$if($eq(%_useSubDiscDirectory%,1),$noop(
			)$set(_nameForDiscDirectory,$replace(%_nameForDiscDirectory%,@OSLASH@@OBRACKET@,/))$noop(
			)$set(_nameForDiscDirectory,$replace(%_nameForDiscDirectory%,@CBRACKET@,)),$noop(
			)$if($eq(%_mergeDiscWhenNotUsingSubDirectory%,1),$noop(
				)$unset(_nameForDiscDirectory),$noop(
				)$set(_nameForDiscDirectory,$replace(%_nameForDiscDirectory%,@OSLASH@@OBRACKET@,[))$noop(
			)$set(_nameForDiscDirectory,$replace(%_nameForDiscDirectory%,@CBRACKET@,]))$noop(
		))$noop(
	))$noop(
)$if(%_nameForDiscDirectory%,%_nameForDiscDirectory%))/

$noop(★ Track # Title --%_filebr% -- %bitrate% -- %BRType% -- %BrVBR% --  ★)
$if($in(%media%,Vinyl),$noop(
	)$if($eq(%_useMusicBrainzStyleForVinylTrack%,1),$noop(
		)$if(%_musicbrainz_tracknumber%,%_musicbrainz_tracknumber%. )$noop(
	)),$noop(
	)$if(%tracknumber%,$if($gt(%totaldiscs%,1),$if($and($eq(%_useSubDiscDirectory%,0),$eq(%_mergeDiscWhenNotUsingSubDirectory%,1)),%discnumber%))$num(%tracknumber%,2). ))

$noop(★ GAME OVER ★)
%_titleForFilename% 
$if($eq(%_showTime%,1),[%_length%] )
$if($eq(%_showBandwidth%,1),[%_fileCBRRate%%_fileVBRRate%%_bitRateSpeed%%_bitRateType%%_audioChannels%])

$noop(★ 00 CREDITS ★)


Root sorting by Artist or performance type, then separated by file format.

Root sorting by file format, then Artist, performance types, etc.
20%20AM

Cover Band & Tribute Releases can optionally be placed in a subdirectory with the Artists they are associated with instead of by their own artists name. This is done by using the sort as tag options.

Enter “*Tribute” or "Cover" in the Album Sort as tag.
Enter the Artist in the Album Artist Sort as tag.

There are also a couple of settings marked Earlier in the Sort. These are for quick and dirty changes to isolate incomplete stuff separately within the output directory instead of along side their complete albums, and to add the artist earlier in when doing that.

Put some incomplete, complete and ‘over-complete’ (complete’s with additional duplicate tracks) on the Right side and save them to see what the differences are with the Earlier Sort and Complete Albums with additional duplicate tracks.

Last.fm plug-in required for using their catagories at the root, instead of Artist names.

…and for the handling of duplicates as shown in the screenshot, see:

2 Likes

@tdiaz Checked out your script above pretty cool but I am getting empty brackets when there is no value in a lot of the directories!

That’s interesting, as anything in those brackets is created from what I’m reading off the files.

Examples:
09. EULA Dancing [3m03s] [320 44100KHz VBR 2ch].mp3
01. Drunken Lullabies [3m51s] [106 44100KHz VBR 2ch].m4a
01. Dead Man's Party [6m22s] [945 44100KHz VBR 2ch].flac
03. Deadbeat Club [4m50s] [974 44100KHz VBR 2ch].m4a

The thing I’m not sure is working right is that VBR where it could be a CBR. … those are mostly for quick visual comparing anyway.

The only Plug-in needed is the Last.fm one, if you want that. I’m pretty sure that nothing else is coming from a plug-in.

Out of curiosity mainly, I wonder what I’d get if I run some of the same files you are getting blanks from… All that stuff is part of any proper file. ,

Well here’s my current one, developed over the past 15 years or so:

$noop(<!-- MusicBrainz Picard Tagger script -->)
$noop(<!-- 2019-10-17 Version 0.11 by Moonbase -->)
$noop(<!-- You should have plugin lastfmng enabled and set up -->)
$noop(<!-- This script also works with Picard 2.x/lastfmng 2.x -->)

$noop(<!-- Remove "Various Artists" on compilations – good for Logitech Mediaserver/SqueezeCenter -->)
$noop(<!-- We use the MB albumartistid for identification because there IS an artist called "Various Artists" -Torsten Pröfrock- -->)
$if($and($eq(%compilation%,1),$eq(%musicbrainz_albumartistid%,89ad4ac3-39f7-470e-963a-56509c546377)),$unset(albumartist) $unset(albumartistsort))

$noop(<!-- Set Original Year and Decade to date of first known release -- instead of using the date of THIS release  -->)
$noop(<!-- Picard/Mutagen will automatically store originalyear as ID3v2.3 TORY [YYYY] or ID3v2.4 TDOR [YYYY-MM-DD], -->)
$noop(<!-- depending on which ID3v2 version is used. Additionally, a TXXX:originalyear tag gets saved for ID3v2,     -->)
$noop(<!-- respectively ORIGINALYEAR for OGG and FLAC files.                                                         -->)
$noop(<!-- Plugin lastfmng sets originaldate to the first known track release year from last.fm                      -->)
$if(%originaldate%,$set(originalyear,$left(%originaldate%,4)))
$noop(<!-- It may happen that we have NO originaldate from the plugin but originalyear from Picard, so base Decade on that -->)
$if(%originalyear%,$set(comment:Songs-DB_Custom1,$left(%originalyear%,3)0s))
$noop(<!-- Fallback: If we have originalyear BUT NOT originaldate, put the originalyear back into originaldate       -->)
$if($and(%originalyear%,$not(%originaldate%)),$set(originaldate,%originalyear%))

$noop(<!-- For a single track, if we couldn't find a grouping and/or genre, set it to the album's grouping and genre -->)
$if(%grouping%,,$setmulti(grouping,%albumgrouping%))
$if(%genre%,,$setmulti(genre,%albumgenre%))

$noop(<!-- Plugin lastfmng sets some album-related tags: we do not want these                           -->)
$unset(albumgenre)
$unset(albumgrouping)
$unset(albummood)
$unset(comment:Songs-DB_Occasion_album)
$unset(comment:Songs-DB_Custom1_album)
$unset(comment:Songs-DB_Custom2_album)
$unset(comment:Songs-DB_Custom3_album)
$unset(comment:Songs-DB_Custom4_album)

$noop(<!-- As workaround for ID3v2.3, store MOOD in TXXX:Mood, since we have no TMOO tag as in ID3v2.4 -->)
$if(%mood%,$set(~id3:TXXX:Mood,%mood%))

$noop(<!-- As workaround for ID3v2.3, store DISCSUBTITLE in TXXX:discsubtitle, since we have no TSST tag as in ID3v2.4 -->)
$if(%discsubtitle%,$set(~id3:TXXX:discsubtitle,%discsubtitle%))

$noop(<!-- Ambiguous album names: store MusicBrainz' _releasegroupcomment and use in file naming later on            -->)
$if(%_releasegroupcomment%,$set(releasegroupcomment,%_releasegroupcomment%))

$noop(<!-- Ambiguous track names: store MusicBrainz' _recordingcomment and use in file naming later on            -->)
$if(%_recordingcomment%,$set(recordingcomment,%_recordingcomment%))

File naming to go with it:

$if($and($eq(%compilation%,1),$or($eq(%albumartist%,),$eq(%musicbrainz_albumartistid%,89ad4ac3-39f7-470e-963a-56509c546377))),$if2(%artistsort%,%artist%)/$if2(%artistsort%,%artist%) - [compilations]/$if2(%artistsort%,%artist%) - %title%$if(%recordingcomment%, \(%recordingcomment%\)),$if2(%albumartistsort%,%albumartist%,%artistsort%,%artist%)/$if(%album%,$if2(%albumartistsort%,%albumartist%,%artistsort%,%artist%) - %album%$if(%releasegroupcomment%, \(%releasegroupcomment%\))$if(%date%%_primaryreleasetype%%_secondaryreleasetype%%releasecountry%, \()$if(%date%,$left(%date%,4))$if($and(%date%,%_primaryreleasetype%), )$if(%_primaryreleasetype%,%_primaryreleasetype%)$if($and(%date%%_primaryreleasetype%,%_secondaryreleasetype%),\, )$if(%_secondaryreleasetype%,%_secondaryreleasetype%)$if($and(%date%%_primaryreleasetype%%_secondaryreleasetype%,%releasecountry%),\, )$if(%releasecountry%,%releasecountry%)$if(%date%%_primaryreleasetype%%_secondaryreleasetype%%releasecountry%,\))/$if(%discsubtitle%,$if(%media%,%media% ,)$if(%discnumber%,%discnumber%: ,)%discsubtitle%/,),)$if2(%artistsort%,%artist%) - %title%$if(%recordingcomment%, \(%recordingcomment%\)))

I use fdemmer’s lastfmng plugin to get genres and some other stuff, so for completeness’ sake here is the plugin’s config.ini I use:


[global]
soundtrack_is_no_genre = True
ignore_feat_artists = False
; string used as fallback, when no tag value could be determined
default_unknown =
; this disables both album and track stats if set to False
print_tag_stats = True
print_tag_stats_album = True
print_tag_stats_track = False
; only enable collect_unused if you have sqlite (windows and macos may not)
collect_unused = False
lastfm_host = ws.audioscrobbler.com
lastfm_port = 443
; author's last.fm api key -- please use your own!
lastfm_key = REDACTED

[category-defaults]
; do/don't collect tags for that category
enabled = True
; a hard limit for how many tags are assigned to the metatag
limit = 5
; name of another category, unused tags in this category will be used in the given one.
overflow =
; add all tags from the other category to this one
prepend =
; used to join tags if >1 are to be used (None to use multtag)
separator =
; alphabetically sort tags before joining to string
sort = False
; percentage; only the tags with a score above x% of the most popular are used
threshold = 0.5
; apply titlecase() function to each tag
titlecase = True

[category-grouping]
# grouping is used as major/high level category
limit = 1
separator =
overflow = genre
metatag_track = grouping
metatag_album = albumgrouping

[category-genre]
limit = 5
threshold = 0.4
prepend = grouping
metatag_track = genre
metatag_album = albumgenre

[category-mood]
# eg. angry, cheerful, clam, ...
limit = 5
metatag_track = mood
metatag_album = albummood

[category-occasion]
# eg. background, late night, party
limit = 5
metatag_track = comment:Songs-DB_Occasion
metatag_album = comment:Songs-DB_Occasion_album

[category-category]
# i don't really know
limit = 5
metatag_track = comment:Songs-DB_Custom2
metatag_album = comment:Songs-DB_Custom2_album

[category-country]
# country names
limit = 2
threshold = 0.7
metatag_track = comment:Songs-DB_Custom4
metatag_album = comment:Songs-DB_Custom4_album

[category-city]
# city names
limit = 1
threshold = 0.7
metatag_track = comment:Songs-DB_Custom3
metatag_album = comment:Songs-DB_Custom3_album

[category-decade]
# musical era, eg. 80s, 90s, ...
limit = 1
threshold = 0.7
titlecase = False
metatag_track = comment:Songs-DB_Custom1
metatag_album = comment:Songs-DB_Custom1_album
regexp = ^([1-9][0-9])*[0-9]0s$

[category-year]
# the full year, eg. 1995, 2000, ...
# not recommended: let musicbrainz provide that
enabled = False
limit = 1
threshold = 0.7
titlecase = False
metatag_track = year
regexp = ^[1-9][0-9]{3}$


[searchlist]
;;; loosely based on the "standard" id3v1 genres
;;; #TODO i am not very happy with this. maybe the contemporary genres
;;;       list in wikipedia would be better as a basis for grouping.
grouping = Blues, Classic Rock, Country, Dance, Disco, Funk,
           Grunge, Hip-Hop, Jazz, Metal, New Age, Oldies, Pop,
           R&B, Rap, Reggae, Rock, Techno, Industrial, Alternative,
           Ska, Death Metal, Pranks, Soundtrack, Euro-Techno, Ambient,
           Trip-Hop, Vocal, Jazz+Funk, Fusion, Trance, Classical,
           Acid, House, Game, Sound Clip, Gospel, Noise,
           Alternative Rock, Bass, Soul, Punk, Space, Meditative,
           Instrumental Pop, Instrumental Rock, Ethnic, Gothic, Darkwave,
           Techno-Industrial, Electronic, Pop-Folk, Eurodance, Dream,
           Southern Rock, Comedy, Cult, Gangsta,
           Pop/Funk, Jungle, Native US, Cabaret, New Wave, Psychadelic,
           Rave, Showtunes, Trailer, Lo-Fi, Tribal, Acid Punk, Acid Jazz,
           Polka, Retro, Musical, Rock & Roll, Hard Rock, Folk,
           Folk-Rock, National Folk, Swing, Fast Fusion, Bebob, Latin,
           Revival, Celtic, Bluegrass, Avantgarde, Gothic Rock,
           Progressive Rock, Psychedelic Rock, Symphonic Rock, Slow Rock,
           Big Band, Chorus, Easy Listening, Acoustic, Humour, Speech,
           Chanson, Opera, Chamber Music, Sonata, Symphony, Booty Bass,
           Primus, Porn Groove, Satire, Slow Jam, Club, Tango, Samba,
           Folklore, Ballad, Power Ballad, Rhytmic Soul, Freestyle, Duet,
           Punk Rock, Drum Solo, Acapella, Euro-House, Dance Hall, Goa,
           Drum & Bass, Club-House, Hardcore, Terror, Indie,
           Polsk Punk, Beat, Heavy Metal,
           Black Metal, Crossover,
           Merengue, Salsa, Trash Metal, Anime, Synthpop

;;; genre should not also contain tags from grouping or you'll get duplicates!
genre = soundtrack, score, Instrumental, hair metal,
    2 tone, a cappella, abstract hip-hop, acid, acid jazz,
    acid rock, acid house, acoustic guitar, acoustic rock, adult alternative,
    adult contemporary, alternative country, alternative folk,
    alternative metal, alternative pop, alternative rock, anti-folk, aor, austropop, britpop,
    art rock, atmospheric, aussie hip-hop, avant-garde, ballads, baroque, beach,
    beats, bebop, big band, big beat, blaxploitation, blue-eyed soul, bluegrass, blues
    rock, boogie rock, boogie woogie, bossa nova, breakbeat, breaks, brit pop,
    brit rock, british invasion, broadway, bubblegum pop, cabaret, calypso, cha
    cha, choral, christian rock, classic country, classical guitar, club,
    college rock, composers, contemporary classical, contemporary country, contemporary folk, country
    folk, country pop, country rock, crossover, dance pop, dancehall, dark
    ambient, darkwave, delta blues, dirty south, disco, doo wop, doom metal,
    downtempo, dream pop, drum and bass, dub, dub reggae, dubstep, ebm, east coast
    rap, easy listening, edm, electric blues, electro, electro pop, elevator music,
    emo, emocore, ethnic, eurodance, europop, experimental, fingerstyle, folk
    jazz, folk pop, folk punk, folk rock, folksongs, free jazz, french rap,
    funk metal, funk rock, fusion, g-funk, gaelic, gangsta rap, garage,
    garage rock, glam rock, goa trance, gospel, gothic, gothic metal, gothic
    rock, gregorian, groove, guitar, happy hardcore, hard rock,
    hardcore, hardcore punk, hardcore rap, hardstyle, heavy metal, honky tonk,
    horror punk, house, humour, hymn, idm, indie folk, indie pop, indie rock,
    industrial, industrial metal, industrial rock, instrumental
    hip-hop, instrumental rock, j-rock, jangle pop, jazz fusion, jazz
    vocal, jungle, latin, latin jazz, latin pop, lounge, lovers rock, lullaby,
    madchester, mambo, medieval, melodic rock, minimal, minimalism, modern country, modern
    rock, mood music, motown, ndw, ndh, neo-soul, new age, new romantic, new wave, noise,
    northern soul, nu-metal, oi, old school rap, opera, orchestral, philly soul,
    piano, political reggae, polka, pop life, pop punk, pop rock, pop soul, post
    punk, post rock, power pop, progressive, psychedelic,
    psychedelic folk, psychedelic punk, psychedelic rock, psychobilly,
    psytrance, quiet storm, r&b, ragga, rap, rap metal, reggae pop,
    reggae rock, rnb, rock and roll, rock opera, rockabilly, rocksteady, roots, roots
    reggae, rumba, salsa, samba, schlager, screamo, shanty, shock rock, ska punk,
    smooth jazz, soft rock, southern rock, space rock, speech, spoken word, standards,
    stoner rock, surf rock, swamp rock, swing, symphonic metal, symphonic rock,
    synth pop, synthpop, tango, techno, teen pop, thrash metal, traditional country,
    traditional folk, tribal, turntablism, underground, underground
    hip-hop, underground rap, urban, vocal trance, waltz, west coast rap,
    western swing, world, world fusion, power metal, alternative punk,
    post punk, folktronica, glam, folk metal, viking metal, progressive metal,
    downbeat, groovesalad, post grunge, christian, classic metal, melodic metal,
    j-pop, j-rock, neoclassical, composer, symphonic, speed metal, post metal

mood = angry, bewildered, bouncy, calm, cheerful, chill, cold,
       complacent, crazy, crushed, cynical, dark, dramatic, dreamy, drunk,
       eclectic, emotional, energetic, envious, feel good, flirty, funky, groovy,
       happy, haunting, healing, high, hopeful, hot, humorous, inspiring, intense,
       irritated, laidback, lonely, lovesongs, meditation, melancholic, melancholy,
       mellow, moody, morose, passionate, peace, peaceful, playful, pleased,
       positive, quirky, reflective, rejected, relaxed, retro, sad, sentimental,
       sexy, silly, smooth, soulful, spiritual, suicidal, surprised, sympathetic,
       trippy, upbeat, uplifting, weird, wild, yearning, catchy, nostalgic,
       heartbreaking, lovely, depressive, cool, slow, sweet, soft, fun, heavy,
       cheap, fast

occasion = background, birthday, breakup, carnival, chillout,
           christmas, death, dinner, drinking, driving, graduation, halloween, hanging
           out, heartache, holiday, late night, love, new year, party, protest, rain,
           rave, romantic, sleep, spring, summer, sunny, twilight, valentine, wake up,
           wedding, winter, work, xmas

category = animal songs, amazing, awesome, attitude, autumn, b-side, ballad,
           banjo, bass, beautiful, body parts, bootlegs, brass, cafe del mar, chamber
           music, clarinet, classic, classic tunes, compilations, covers, cowbell,
           deceased, demos, divas, dj, drugs, drums, duets, field recordings, female,
           female vocalist, film score, flute, food, genius, girl group, great lyrics,
           guitar solo, guitarist, handclaps, harmonica, historical, horns, hypnotic,
           influential, insane, jam, keyboard, legends, life, linedance, live, loved,
           lyricism, male, male vocalist, masterpiece, melodic, memories, musicals,
           nostalgia, novelty, number songs, old school, oldie, oldies, one hit
           wonders, orchestra, organ, parody, poetry, political, promos, radio
           programs, rastafarian, remix, samples, satire, saxophone, showtunes,
           sing-alongs, singer-songwriter, slide guitar, solo instrumentals,
           speech, stories, strings, stylish, synth, top 40, traditional,
           trumpet, unique, unplugged, violin, virtuoso, vocalization, vocals,
           cover, epic, best of

;;; #TODO translate countries. eg. icelandic -> iceland
country = african, american, arabic, australian, austrian,
          belgian, brazilian, british, canadian, caribbean, celtic, chinese, cuban,
          danish, dutch, eastern europe, egyptian, estonian, european, finnish,
          french, german, greek, hawaiian, ibiza, icelandic, indian, iranian, irish,
          island, israeli, italian, jamaican, japanese, korean, mexican, middle
          eastern, new zealand, norwegian, oriental, polish, portuguese, russian,
          scandinavian, scottish, southern, spanish, swedish, swiss, thai, third
          world, turkish, welsh, western, texas, uk, belgium, england, scotland,
          usa, suomi, germany, austria, finland, icelandic

city = acapulco, adelaide, amsterdam, athens, atlanta,
       atlantic city, auckland, austin, bakersfield, bali, baltimore, bangalore,
       bangkok, barcelona, barrie, beijing, belfast, berlin, birmingham, bogota,
       bombay, boston, brasilia, brisbane, bristol, brooklyn, brussels, bucharest,
       budapest, buenos aires, buffalo, calcutta, calgary, california, cancun,
       caracas, charlotte, chicago, cincinnati, cleveland, copenhagen, dallas,
       delhi, denver, detroit, dublin, east coast, edmonton, frankfurt, geneva,
       glasgow, grand rapids, guadalajara, halifax, hamburg, hamilton, helsinki,
       hong kong, houston, illinois, indianapolis, istanbul, jacksonville, kansas
       city, kiev, las vegas, leeds, lisbon, liverpool, london, los angeles,
       louisville, madrid, manchester, manila, marseille, mazatlan, melbourne,
       memphis, mexico city, miami, michigan, milan, minneapolis, minnesota,
       mississippi, monterrey, montreal, munich, myrtle beach, nashville, new
       jersey, new orleans, new york, new york city, niagara falls, omaha, orlando,
       oslo, ottawa, palm springs, paris, pennsylvania, perth, philadelphia,
       phoenix, phuket, pittsburgh, portland, puebla, raleigh, reno, richmond, rio
       de janeiro, rome, sacramento, salt lake city, san antonio, san diego, san
       francisco, san jose, santiago, sao paulo, seattle, seoul, shanghai,
       sheffield, spokane, stockholm, sydney, taipei, tampa, tijuana, tokyo,
       toledo, toronto, tucson, tulsa, vancouver, victoria, vienna, warsaw,
       wellington, westcoast, windsor, winnipeg, zurich

; add words (in uppercase!) that should be kept uppercase by titlecase
abbreviations = USA, UK, EBM, EDM, IDM, NDW, NDH, R&B, AOR


[translations]
; <name1> is translated into <name2>
acoustic guitar = guitar
ambient piano = piano
brit pop = britpop
chill out = chillout
depressed = depressive
deutsch = german
dnb = drum and bass
drum 'n' bass = drum and bass
drum n bass = drum and bass
electronica = electronic
english = england
female vocalists = female vocalist
hip hop = hip-hop
hiphop = hip-hop
jpop = j-pop
jrock = j-rock
male vocalists = male vocalist
melancholic = melancholy
nu metal = nu-metal
post-grunge = post grunge
post-metal = post metal
post-punk = post punk
post-rock = post rock
prog rock = progressive rock
relax = relaxed
relaxing = relaxed
rock 'n' roll = rock & roll
rock and roll = rock & roll
rock n roll = rock & roll
rock'n'roll = rock & roll
rnb = r&b
sex = sexy
trip hop = trip-hop
minimalist = minimalism
modern classical = contemporary classical
soundtracks = soundtrack
speeches = speech
00s = 2000s
10s = 2010s
20s = 1920s
30s = 1930s
40s = 1940s
50s = 1950s
60s = 1960s
70s = 1970s
80s = 1980s
90s = 1990s

It will sort each and everything under the (album) artist sort names. Titles picked up from compilation samplers are stored in a special subfolder albumartistsort - [compilations]. The script uses release group comments to differentiate between albums of the same name (Peter Gabriel, Weezer, Elis, …), adds a release year, album type and release country in parentheses and disambiguates tracks of the same name by their recording comments (adding things like (live, 1990-03_ Billboard The Venue, Melbourne, Australia) to the track filename to avoid things like title (1).flac, title (2).flac.


(Disregard the sole [compilations] folder, that was accidentally generated with an older script version.)

The year shown in the album folder name is the release year, the country the release country, so I can distinguish releases with the same name.

Oh, and there are no track numbers because I’m interested in the title and not their storage location on a particular medium. There is also some intended redundancy (repeated artist names) because the album and track artists can be different.

This structure makes me happy when travelling: It’s much easier copying stuff together onto a USB drive or SD card and still know which title is which. I was so fed up with USB sticks containing a hundred entries starting with 01. … and no artist name

6 Likes

I’ve updated the MBP YA Magic-Script that does more stuff too to v1.9.

If there are no values within the brackets, they will not show at all. (So, no more [ ] [ ] empties)
Re-organized the Settings section.
Cleared up the examples and documentation a bit.
…and put in some “Earlier in the Sort…” options for re-directing stuff while organizing.
To use those on and off, you’d have to go into the Options and change the values as needed when saving various sets of files.

3 Likes

@tdiaz Great Update, big Improvements!

…and It’s 2.0 now, it does what I want, it’s been taken apart function by function.

Gone through, line by line and the CBR/VBR section has been fixed up a lot.

I had some squirrelly voodoo going on with the File Metrics being created. It was probably a combination of things script wise and pre-processed file wise.

With “Ignore Tags” set, to where I’m just over-riding the two I use within the script for special album placement, it’s all good!

I had some cross-use of %_underScore% vs %noUnderScore% so some tags were getting created and then that was having an affect on anything that already had and MBID …and the unintended tags.

Sorry for clogging up the thread … :slight_smile:

Now I’ll go mess with the Python for a bit … and see what I come up with.

2 Likes

I just wanted to share that I updated my script to v2.0 if interested check it out. And once again thanks the all the people who help me out within this board, it’s like school for me I just keep on learning from the great teachers who dwell here!

1 Like