Hi there, I am working on refining my MusicBrainz picard naming script. Im not great at scripting or coding.
However I did get help before and this is the file naming script I have $swapprefix($if2(%albumartist%,%artist%),A,An,The,Le)/ $if(%_date%,\(%_date%\) )%album% [%_bits_per_sample%-bit $div(%_sample_rate%,1000) kHz$if(%_source%, %_source%)]$if(%catalognumber%, \(%catalognumber%\))/ $if(%_discfolder%,%_discfolder%/) $num(%tracknumber%,2) - %artist% - %title%
Along with a Script in the script’s settings as `$set(_date,$left($if2(%originalyear%,%date%),4))
$if($eq(%media%,Compact Disc),$set(_source,CD))
// …and etc transforms to taste: https://musicbrainz.org/doc/Release/Format
$if($gt(%totaldiscs%,1),$set(_discfolder, Disc %discnumber%))`
However, there are a few things extra I would like to do with the script.
- Any lossy files such as mp3, Ogg, m4a etc instead of having [bit-44khz] due to the script, just instead have [320kbps mp3] for mp3 tracks that are 320kbps for example and for tracks that are 128kbps m4a files. the folder name would have [128kbps m4a] in the folder name.
- Some tracks would have _ due to a character that is not compatible with windows. any way to replace
whatever_ whatever
withwhatever, whatever
with the exception being if its in the MusicBrainz database. so replace _ with, with space afterwards. - The final hardest part is that I want to sort out DJ mixes and radio recordings as this is what they are currently like https://imgur.com/a/QYzKQua. so I was wondering if there’s a way depending on how DJ mixes are added into MusicBrainz to put DJ mixes in their own folder such as DJ mixes sorted by DJ mixer. then for radio shows, to be put into a radio folder (not sure how to sort but could be sorted by the main host or program name such as dead ringers. but then for radio one essential mixes do they go in the dj mixes folder or radio folder? Or do I put dj and radio mixes into 1 folder sorted by dj mixer and radio host as what is suggested here on reddit.
- the next and final part is to be able to sort audiobooks which are prittly well organised but again could be organised much better into something universal.
- So I guess in picards settings I would have to change the folder structure from music to 1 directory up so that picard can move music into the music folder. dj mixes into dj mixes and radio shows into radio shows folder (unless i put radio and dj mixes into a compilations folder instead).
Any help would be appreciated.
thank you
update below, this is my renaming script so far. lossless lossy extension is needed.
$noop( ======================================================================= )
$noop( === Coded by Goldmaster with help from r/musichoarder discord === )
$noop( ======================================================================= )
$noop(Replace part is to replace ANY _ or: which don`t work in windows with a comma, space.)
$replace(
$replace(
$set(_Directory,)
$if($not(%_Directory%),$if($inmulti(%releasetype%,audiobook),$set(_Directory,Audiobooks)))
$if($not(%_Directory%),$if($inmulti(%secondaryreleasetype%,audiobook),$set(_Directory,Dj Mixes)))
$if($not(%_Directory%),$if($inmulti(%releasetype%,audiobook),$set(_Directory,Radio),$set(_Directory,Music)))
$noop(For any album artists such as The Chemical Brothers, change the folder name to say Chemical Brothers, The.)
$swapprefix($if2(%albumartist%,%artist%),A,An,The,Le)/
$noop(Add in the original date the album came out for example a remastered 2017 version of a 1995 copy would start the year as 1995 in brackets.)
$if(%_date%,\(%_date%\) )%album%
$noop(Using the lossles addon, any lossless albums would read as [16-bit 44khz] for cd qulity tracks, while lossy albums would read as [320kbps] for 320kbps tracks and add the media to the end.)
[$if($is_lossless(),%_bits_per_sample%-bit $div(%_sample_rate%,1000) kHz %_extension%,$replace(%_bitrate%,.0,)kbps %_extension%) %media%]
$noop(Adds the catalog number, but if there are any releases that have [none] in the catalog field, then just ignore.)
$if($and(%catalognumber%,$ne(%catalognumber%,[none])), \(%catalognumber%\))/
$noop(For mutidisc albums add a subfolder such as Disc 1, Disc 2 ect.)
$if(%_discfolder%,%_discfolder%/)
$noop(This is for vinyl albums which makes sure tracks display as A1, A2 ect.)
$if($in(%media%,Vinyl),%_musicbrainz_tracknumber%,$num(%tracknumber%,2)) - %artist% - %title%
$noop(Final part which closes of the script, like at the start, this for replacing ANY: or _ with a comma)
,:,\, )
,_,\, )
just need to fix dj mixes, radio shows and audiobooks.