Repository for neat file name string patterns and tagger script snippets

Added the ability to remove Various Artists. Check the very bottom on how to make this so. Should only be done on those albums only. Let me know what you think.

$noop( *** DO NOT EDIT THE AREA BELOW | EDITABLE AREA WILL BE AT THE VERY BOTTOM *** )
    $set(MainFolder1,-= $upper($left(%albumartist%,1)) =-/)
    $set(MainFolder2,-= $upper($left(%albumartistsort%,1)) =-/)
    $set(MainFolder3,)
    $set(MainFolder4,-= $upper($left(%artist%,1)) =-/)
    $set(MainFolder5,-= $upper($left(%artistsort%,1)) =-/)
    $set(Artist1,$replace($rreplace(%albumartist%,[_:*?"<>|],-),?,)/)
    $set(Artist2,$replace($rreplace(%albumartistsort%,[_:*?"<>|],-),?,)/)
    $set(Artist3,$replace($rreplace(%artist%,[_:*?"<>|],-),?,)/)
    $set(Artist4,$replace($rreplace(%artistsort%,[_:*?"<>|],-),?,)/)
    $set(Album1,$replace($rreplace(%album%,[_:*?"<>|], -),?,)$if(%date%,$if(%album%, )[$left(%date%,4)])/)
    $set(Album2,$replace($rreplace($if(%date%,$if(%album%, )[$left(%date%,4)] )%album%,[_:*?"<>|], -),?,)/)
    $set(Album3,$replace($rreplace(%album%,[_:*?"<>|], -),?,)/)
    $set(Album4,)
    $set(MultiDisc1,$if($gt(%totaldiscs%,1),Disc $num(%discnumber%,1)/)
    $set(MultiDisc2,)
    $set(PreTitle1,$replace($rreplace(%albumartist% - %album% -,[_:*?"<>|], -),?,))
    $set(PreTitle2,)
    $set(Track1, $num(%tracknumber%,2) - )
    $set(Track2, $num(%discnumber%,1)-$num(%tracknumber%,2) - ))
    $set(Track3,)
    $set(Title,$replace($rreplace(%title%,[_:*?"<>|],),?,))
$noop( *** DO NOT EDIT THE AREA ABOVE| EDITABLE AREA IS JUST BELOW *** )


$noop(
*** The Following will use the example of artist: Amy Winehouse and album: Back to Black *** 
*** Default output: -=A =-/Amy Winehouse/Back to Black [2007]/Disc 1/Amy Winehouse - Back to Black - 01 - Rehab ***
*** Change the NUMERICAL value ONLY! Example: %MainFolder1% would be changed to %MainFolder2% ***
*** Only change the numerical value to either 1 or 2, anything else will mess things up. *** )

%MainFolder1%    $noop( OPTION 1 -= A=- | OPTION 2 -= W =- | OPTION 3 = No single character folder will be created. )
%Artist1%            $noop( OPTION 1 = Amy WineHouse| OPTION 2 = Winehouse, Amy )
%Album1%            $noop( OPTION 1 = Back to Black [2007] | OPTION 2= [2007] Back to Black  | OPTION 3 = Back to Black )
%MultiDisc1%        $noop( OPTION 1 = If album has more than 1 Disc, then add Disc folders | OPTION 2 = Do not sort by Disc, put all files into a single folder. )
%PreTitle1%        $noop( OPTION 1 = Show Artist and Album in the track title | OPTION 2 = Do not display Artist or Album)
%Track1%            $noop( OPTION 1 = Track Number: 01 | OPTION 2: Track Number: 1-01-> This is best if MultiDisc is set to 2, because you will have 2 track numbers as 01 - *track names*, etc. )
%Title%            $noop( NO OPTION - Just display the name of the track.

Want to remove Various Artists - then do the following.
Should be done on those albums ONLY!
Change %MainFolder1% to either  3 or 4. Sorts by artist and not album artist.
Change %Artist1% to either 3 or 4. Sorts by artist and not album artist.
Change %PreTitle% to 2. Removes the artist name and album name from the track name.
Change %Track1% to 3. This removes the track number from the track name.)

@FragaGeddon… Any idea why the script you posted may be creating excessive dashes throughout the naming scripts? I’m getting many replaced characters throughout the Artist, Album and Title.

i.e. ‘Eminem - Re -apse - Refi - - - 1-17 - Beaif.mp3’

Seems to be replacing t, l, u, etc. New to this kind of scripting but familiar with coding in general and can’t get the finesse of this.

Seems like the forum messed it up a bit. So I put it in a text document and you can view it here: https://docs.google.com/document/d/1X_E02unQVq8n67zf5IhS8vhQkiA0ifi3xMxKJ30YUHk/edit?usp=sharing

You’ll just be able to do a CTRL+A, then CTRL+C to copy it. When you paste it in to the program, the text may seem a little big, But once you click on Make it So! and go back in, the font size will be normal again.

3 Likes

Hello, new guy here.
I am really struggling with all this naming stuff. Can anyone help with a script that would produce the following results?
for a single artist:
/Phil Collins/Both Sides/Phil Collins - 01 - Both Sides of the Story.mp3
and for a various artist:
/Various Artists/The Best of 1980 - 1990, Volume 7/Black - 02 - Wonderful Life.mp3
/Various Artists/The Best of 1980 - 1990, Volume 7/Fine Young Cannibals - 03 - She Drives Me Crazy.mp3

After looking at the posts in this thread, I might like to try adding the CD number, so I guess it would like something like this:
/Various Artists/The Best of 1980 - 1990, Volume 7/CD1/Black - 02 - Wonderful Life.mp3

Any help would be greatly appreciated.

1 Like

Hi (thebradleys) - thanks for sharing your script. I am still a newbie to this tool. I used your script and tried to modify few things but wasn’t successful in getting what i was looking for. Hoping you can provide some suggestions.

I was trying to tag The Best of Eddie Cochran (2 CDs - 40 tracks) album. MB clustered it into 7 different albums. Not sure why would it do that although it exists in MB database (MBID: 35edcc27-a9c9-47bd-8abc-69df3f149fca ). Is it because of the scripting or some settings that is conflicting? Isn’t there a way to manually tag an entire album with MBID instead of a cluster, lookup, and scan approach?

I do not want to have multiple artists in the album name, so I have enabled standard artist names, and the script only uses album artist. Hope it’s not conflicting.

Have you enabled use release/tracks relationship for a better match?

I am not able to get genres in spite of enabling last.fm and MB Mood genre plugins to refresh the tags.

I am looking for is - Root folder / Album Artist (no featuring or multiple artists) / Album [Year] / Title. If more than one disc exists, then disc number followed by a track number 01-01 (02-01) in the title name would be helpful.

Thanks a lot!

Hi rdswift, I was hoping if you could help me modify the below script.

I would like to see: Root folder / Album Artist (no featuring or multiple artists) / Album [Release Year] / Title. If more than one disc exists, then the disc number followed by a track number 01-01 (02-01) in the title name would be helpful.

This is based on a subset of my naming script, but I think it will do most of what you want. I believe that all of the elements are there, but they may be in a slightly different order so you might have to move the various bits around. It processes soundtracks, singles, various artists compilations and “normal” albums differently, and saves them to a slightly different structure as:

Process as Soundtrack
    Format: /[Soundtrack]/[year] Album/Disc-Track Title [Artist]

Process as Single
    Formats: /~ A ~/Album Artist/[~Singles~]/[year] Title [feat.]

Process as Standard
    Formats: /~ A ~/Album Artist/[year] Album/Disc-Track Title [feat.]
             /~ # ~/Album Artist/[year] Album/Disc-Track Title [feat.]
             /[Various Artists]/[year] Album/Disc-Track Title [Artist]
             /[Unknown Artists]/[year] Album/Disc-Track Title [Artist]

Note that one of the elements relies on a plugin that I wrote which is not (yet) in Picard’s list of standard plugins. It is called Additional Artists Variables and is available for download from my GitHub repository. There is also a User Guide available, which includes some examples of how the plugin could be used.

Here’s the script. Note that I haven’t tested this, so it might need some tweaking to do exactly what you’re after:

$noop(
#######################################################################
#
#  Picard File Naming Script for krishk                      2019-02-14
#  Prepared by: rdswift
#
#  License: GPLv3.0
#
#######################################################################
#
#  This script relies on inputs provided by the "Additional Artists
#  Variables" plugin.  This plugin is freely available for use under
#  GPL-2.0 or later, and the latest version can be downloaded from the
#  author's repository at:
#
#  https://github.com/rdswift/picard-plugins/raw/2.0_RDS_Plugins/plugins/additional_artists_variables/additional_artists_variables.zip
#
#######################################################################
)

$noop(
#######################################################################
#
#  Constants
#
#######################################################################
)
$set(_cUnknownArtistID,125ec42a-7229-4250-afc5-e057484327fe)
$set(_cVariousArtistID,89ad4ac3-39f7-470e-963a-56509c546377)
$set(_cUnknownArtist,[Unknown Artist])
$set(_cVariousArtist,[Various Artists])
$set(_cUnknownAlbum,[Unknown Album])
$set(_cNoTitle,[Unknown Title])
$set(_cSingles,[~Singles~])
$set(_aTitleMaxLength,65)
$set(_tTitleMaxLength,65)
$set(_tFilenameMaxLength,120)


$noop(
#######################################################################
#
#  Defaults if "Additional Artists Variables" plugin not loaded or metadata is missing
#
#######################################################################
)
$set(_nFAA,$if2(%_artists_album_all_std%,%albumartist%,%_cUnknownArtist%))
$set(_nPAA,$if2(%_artists_album_primary_std%,%albumartist%,%_cUnknownArtist%))
$set(_nFAAS,$if2(%_artists_album_all_sort%,%albumartistsort%,%_cUnknownArtist%))
$set(_nPAAS,$if2(%_artists_album_primary_sort%,%albumartistsort%,%_cUnknownArtist%))
$set(_nFAAPS,$if2(%_artists_album_all_sort_primary%,%albumartistsort%,%_cUnknownArtist%))

$set(_nPTA,$if2(%_artists_track_primary_cred%,%artist%,%_cUnknownArtist%))
$set(_nATA,%_artists_track_additional_cred%)
$set(_nFTA,$if2(%_artists_track_all_cred%,%artist%,%_cUnknownArtist%))

$set(_nAN,$if2(%album%,%_cUnknownAlbum%))
$set(_nANT,$if2(%album%,%_cUnknownAlbum%))

$set(_nTN,$if2(%title%,%_cNoTitle%))
$set(_nTNT,$if2(%title%,%_cNoTitle%))

$noop(
-----------------------------------------------------------------------
-  Trim the album and track names used to create directories and tracks
-  if they are longer than the maximum lengths set in the "Constants"
-  section.
-----------------------------------------------------------------------
)
$if($gt($len(%_nANT%),%_aTitleMaxLength%),$set(_nANT,$left(%_nANT%,$sub(%_aTitleMaxLength%,3))...))
$if($gt($len(%_nTNT%),%_tTitleMaxLength%),$set(_nTNT,$left(%_nTNT%,$sub(%_tTitleMaxLength%,3))...))


$noop(
#######################################################################
#
#  Initialize Working Variables
#
#######################################################################
)
$set(_nMedia,%media%)
$set(_nTotalDiscs,$if2(%totaldiscs%,1))
$set(_nDiscNum,$if2(%discnumber%,1))
$set(_nTotalTracks,$if2(%totaltracks%,1))
$set(_nTrackNum,$if2(%tracknumber%,1))
$set(_nAlbumArtistID,$if2(%musicbrainz_albumartistid%,%_kUnKnownArtistID%))
$set(_nInitial,~ $upper($firstalphachar(%_nFAAPS%,#)) ~/)

$noop(
-----------------------------------------------------------------------
-  If standardized primary album artist is different from credited
-  primary track artist [other than prefix] show in track file name.
-  Otherwise, show any additional credited track artists in track file
-  name.
-----------------------------------------------------------------------
)
$set(_tAlbumArtist,$lower($delprefix(%_nPAA%)))
$set(_tTrackArtist,$lower($delprefix(%_nPTA%)))
$if($eq(%_tAlbumArtist%,%_tTrackArtist%),
    $set(_nFeat,$if(%_nATA%, [feat. %_nATA%],)),
    $set(_nFeat, [%_nFTA%])
)

$set(_nYear,[$left($if2(%originaldate%,%originalyear%,%date%,0000),4)])
$set(_nTNum,$if($gt(%_nTotalDiscs%,1),$num(%_nDiscNum%,2)-,)$num(%_nTrackNum%,2))


$noop(
#######################################################################
#
#  Set Album Type [Single, Soundtrack or Standard]
#
#  Process as Soundtrack
#	Format: /[Soundtrack]/[year] Album/Disc-Track Title [Artist]
#
#  Process as Single
#	Formats: /~ A ~/Album Artist/[~Singles~]/[year] Title [feat.]
#
#  Process as Standard
#	Formats: /~ A ~/Album Artist/[year] Album/Disc-Track Title [feat.]
#                /~ # ~/Album Artist/[year] Album/Disc-Track Title [feat.]
#                /[Various Artists]/[year] Album/Disc-Track Title [Artist]
#                /[Unknown Artists]/[year] Album/Disc-Track Title [Artist]
#
#######################################################################
)
$set(_t1,1=)
$set(_t1,%_t1%$if($lte(%_nTotalDiscs%,1),Y,N))
$set(_t1,%_t1%$if($lte(%_nTotalTracks%,1),Y,N))
$set(_t1,%_t1%$if($in(%_primaryreleasetype%,single),Y,N))
$if($eq(%_t1%,1=YYY),$set(_nAlbumType,Single))

$set(_t2,2=)
$set(_t2,%_t2%$if($eq(%_nAlbumArtistID%,%_cVariousArtistID%),Y,N))
$set(_t2,%_t2%$if($in(%_secondaryreleasetype%,soundtrack),Y,N))
$if($eq(%_t2%,2=YY),$set(_nAlbumType,Soundtrack))

$set(_nAlbumType,$if2(%_nAlbumType%,Standard))


$noop(
#######################################################################
#
#  Set File Path
#
#######################################################################
)
$if($eq(%_nAlbumType%,Soundtrack),$set(_nFilePath,%_cSoundtrack%/%_nYear% %_nANT%/))
$if($eq(%_nAlbumType%,Single),$set(_nFilePath,%_nInitial%/%_nPAAS%/%_cSingles%/))
$if($eq(%_nAlbumType%,Standard),$if($eq($if2(%musicbrainz_albumartistid%,%_cVariousArtistID%),%_cVariousArtistID%),
    $set(_nFilePath,%_cVariousArtist%/%_nYear% %_nANT%/),
    $if($eq($if2(%musicbrainz_albumartistid%,%_cUnknownArtistID%),%_cUnknownArtistID%),
        $set(_nFilePath,%_cUnknownArtist%/%_nYear% %_nANT%/),
        $set(_nFilePath,%_nInitial%/%_nFAAPS%/%_nYear% %_nANT%/)
)))


$noop(
#######################################################################
#
#  Set File Name
#
#######################################################################
)
$if($eq(%_nAlbumType%,Soundtrack),$set(_nFileName,%_nTNum% %_nTNT%%_nFeat%))
$if($eq(%_nAlbumType%,Single),$set(_nFileName,%_nYear% %_nTNT%%_nFeat%))
$if($eq(%_nAlbumType%,Standard),$set(_nFileName,%_nTNum% %_nTNT%%_nFeat%))

$noop(
-----------------------------------------------------------------------
-  Trim the file name if it is longer than the maximum length set in
-  the "Constants" section.
-----------------------------------------------------------------------
)
$if($gt($len(%_nFileName%),%_tFilenameMaxLength%),$set(_nFileName,$left(%_nFileName%,$sub(%_tFilenameMaxLength%,3))...))


$noop(
#######################################################################
#
#  Output the path and file name to use.
#
#######################################################################
)

%_nFilePath%/%_nFileName%


$noop(
#######################################################################
#
#  End of script.
#
#######################################################################
)

I hope this helps.

EDIT: Before anybody tells me that the code could be tightened up and shortened by combining things like the album type testing, I already know that. :wink: I tried to write this as generically as possible so that it could be (relatively) easily modified to suit a particular desired output. That’s also why I tried to create each of the naming “elements” first, and then just assemble them in the desired order at the end. Hopefully the various comments throughout will help anyone wanting to use this as a starting point for their own file naming script.

EDIT: I just realized that this might be more appropriate in the Repository for neat file name string patterns and tagger script snippets thread. @Freso, if you agree, can you please move it? Thanks.

3 Likes

Hi rdswift, I don’t know why I am not receiving any email notifications in spite of having it enabled in the settings. Just saw your response. Thank you so much for taking out your time to help with the script.

Can you please confirm if the script would create separate folders for soundtrack, singles, and standard albums? I wanted all of them into one album artist folder. Also, being a rookie, I don’t think I have the skill to make any tweakings to your plugin :smile: . At least, can you point me to a particular section of the plugin that I should be looking for?

I thought I was trying to keep it simple (lol). I was wondering if I could just use the script to rename and structure the folders. The metadata copied from Picard or MB database should automatically override the title name by default, right?

FragaGeddon,

Would you be able to add options for release country, file format? Images as example. Only necessary for folders I think.

@FragaGeddon I have played around with you code and have reworked it to give me the results I like. Thank you for the nice setup work!

I was going to edit my original post, but apparently there’s a time limit on edits. I recently made a change to my script to handle releases with more than 100 tracks. So I’m posting my updated script here.

This script gives a layer of folders with the initial letter of the album artist sort name, then the sort name itself, next the album name, with release comment, and single or EP if appropriate. The songs are in the form: Track number - artist - title. Multiple disc releases are all in the same folder with the disc number tacked on to the front of the track number.
Back at the root level, there are separate folders for soundtracks and various artist compilations. Under those, there’s another layer of initial letters, this time of the swapprefix’ed album names, then those names, with the file names under those in the same format as before.

Examples:
Tagged Music\~D~\Dylan, Bob\Blood on the Tracks\01 - Bob Dylan - Tangled Up in Blue.mp3
Tagged Music\~C~\Crosby, Bing\Bing Sings 96 of His Greatest Hits\711 - Bing Crosby with The Andrews Sisters - Vict’ry Polka.mp3
Tagged Music\Soundtrack\~W~\Wizard of Oz, The\02 - Harold Arlen - Over the Rainbow.mp3
Tagged Music\Various Artists\~1~\1959- Jazz’s Greatest Year\02 - Miles Davis & Gil Evans - The Pan Piper.mp3
Tagged Music\~M~\Mann, Manfred, Earth Band\Blinded by the Light _ Spirit in the Night (Single)\01 - Manfred Mann’s Earth Band - Blinded By The Light.mp3
Tagged Music\~D~\Dire Straits\ExtendedancEPlay (EP)\01 - Dire Straits - Twisting by the Pool.mp3
Tagged Music\~R~\Rush\R40 Live (Only @ Best Buy version with starman flashlight)\210 - Rush - 2112.mp3
Tagged Music\Soundtrack\~S~\Sid Meier’s Civilization IV (game rip)\7103 - Michael Curran, Mark Cromer & Jeff Briggs - Washington Middle.mp3

$replace(
$replace(
$replace(
$replace(
$replace(
$replace(
$if($in(%releasetype%,soundtrack),
	$noop(Soundtracks)
	Soundtrack/~
	$left($swapprefix(%album%,A,An,The),1)~/$swapprefix(%album%,A,An,The)
	$if(%_releasecomment%, \(%_releasecomment%\),$noop())
	$if($in(%releasetype%,single), \(Single\),$noop())
	$if($in(%releasetype%,ep), \(EP\),$noop())/
	$if($gt(%totaldiscs%,1),%discnumber%,$noop())
	$if($gt(%_totalalbumtracks%,99),$num(%tracknumber%,3),$num(%tracknumber%,2)) - %artist% - %title%,
		$if($eq(%albumartist%,Various Artists),
		$noop(Various artist albums)
		Various Artists/~
		$left($swapprefix(%album%,A,An,The),1)~/$swapprefix(%album%,A,An,The)
		$if(%_releasecomment%, \(%_releasecomment%\),$noop())
		$if($in(%releasetype%,single), \(Single\),$noop())
		$if($in(%releasetype%,ep), \(EP\),$noop())/
		$if($gt(%totaldiscs%,1),%discnumber%,$noop())
		$if($gt(%_totalalbumtracks%,99),$num(%tracknumber%,3),$num(%tracknumber%,2)) - %artist% - %title%,
		$noop(Normal albums)
		~$left($if2(%albumartistsort%,%artistsort%,%albumartist%,%artist%),1)~/
		$if2(%albumartistsort%,%artistsort%,%albumartist%,%artist%)/%album%
		$if(%_releasecomment%, \(%_releasecomment%\),$noop())
		$if($in(%releasetype%,single), \(Single\),$noop())
		$if($in(%releasetype%,ep), \(EP\),$noop())/
		$if($gt(%totaldiscs%,1),%discnumber%,$noop())
		$if($gt(%_totalalbumtracks%,99),$num(%tracknumber%,3),$num(%tracknumber%,2)) - %artist% - %title%)
)
,*,[x])
,?,)
,:,-)
,",')
,<,{)
,>,})
5 Likes

Hi
I would like to repay you all for the help I got in the forum and share with my script. I apologize for the level of English. It is very weak, so I explained the description using a translator.

To keep everything working properly, additional plugins will be required:


Additional Artists Variables, link: picard-plugins/plugins/additional_artists_variables at 2.0_RDS_Plugins · rdswift/picard-plugins · GitHub

Also im using:
Feat. Artists in Titles
Standardise Feat.

File Naming script:

$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($gt(%totaldiscs%,1), %totaldiscs%CD)
$if($in(%media%,Vinyl), [Vinyl],)
$if($in(%media%,Cassette), [Cassette],)
$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(%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 $div(%_sample_rate%,1000)kHz)
/$if($gt(%totaldiscs%,1),CD$num(%discnumber%,2)$if(%discsubtitle%, - %discsubtitle%,))
/$if($in(%media%,Vinyl),%_musicbrainz_tracknumber%,$num(%tracknumber%,2)). $if(%_multiartist%,%artist% - ,)$truncate(%title%,70)

Single artist releases:
obraz
Multi artist releases (Compilations, Soundtracks, DJ-Mixes etc)::
obraz
obraz

Below is an explanation of what each command does (for beginners with Picard):

$swapprefix($if2(%_artists_album_primary_std%,%artist%),The,Die,Le)

Creates the main folder with the first artist from the %artists% (it works only withi plugin: Additional Artists Variables). Additionally, moves The, Die, Le to the end of the artist name:
obraz
obraz

/$replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($swapprefix($if2(%albumartist%,%artist%),The,Die,Le), meets , & ), × , & ),; , & ), x , & ), | , & ), • , & ), ⋅ , & ), and , & ),+,&), with , & ), _ , & ), vs , & ), vs. , & ) - $replace($truncate(%album%,100),:,-)

Creates a subfolder with the albumartist or artist (The, Die, Le at the end of the name) and the name of the album. Replaces only at the artist name: “and”, “+”, “with”, “/”, “vs”, “vs.” and more with “&” (because I like to have order and sorted alphabetically albums). Album names have a limit of 100 characters, in addition in their names “:” it is converted to “-”.
obraz

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

In multi-CD editions, it adds a CD prefix with the disc number, e.g. 2CD, 10CD:
obraz

$if($in(%media%,Vinyl), [Vinyl],)
$if($in(%media%,Cassette), [Cassette],)

For vinyl (vinyl, 7", 10", 12") and cassettes adds [Vinyl] and [Cassette]:
obraz

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

[Promo] and [Bootleg]:
obraz

$if($ne_all(%catalognumber%,none,[none]),$if(%catalognumber%, $upper([$replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($rsearch(%catalognumber%,\(.+?\)\(?:; |\$\)+),_,),⋅,),/,),:,),*,),?,),",),<,),>,),|,), ,)])))

If it occurs it adds [catalognumber] (only the first one) with upper case and omission: none, [none]. Also deletes from catalognumber: _, ⋅, /, :, *, ?, ", <, >, | and free spaces:

obraz
Big THANKS to @Harakku for his great job.

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

Adds four digit year: [2019]

$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],)))))))))))

Adds [Album],[Single],[EP],[FM],[Other],[DJ Mix],[Remix],[OST],[Live],[Mixtape],[Compilation] depending on the release.

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

Adds after releasetype, file extension like FLAC, WAV, OGG excluding mp3:
obraz

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

or

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

For files with bits per sample greater than 16 and sample rate greater than 48kHz adds values with suffix bit and kHz e.g. 24bit 96kHz:
obraz

/$if($gt(%totaldiscs%,1),CD$num(%discnumber%,2)$if(%discsubtitle%, - %discsubtitle%,))

For multi-disc releases, it creates subfolders with breaks into discs and disc subtitles (if they occur):
obraz

/$if($in(%media%,Vinyl),%_musicbrainz_tracknumber%,$num(%tracknumber%,2)). $if(%_multiartist%,%artist% - ,)$truncate(%title%,70)

creates a file name in the following format: two-digit song number for CDs and A1, A2 for Vinyls, artist (for albums with multiple artists) and song title:
Single
obraz
Multiple
obraz
Vinyl
obraz

I also use tagger scripts:

$set(date,$left(%date%,4))

Changin full date into four digit year:

$set(album,$rreplace(%album%,\\s\\\(feat. [^\)]+\\\),))

Remove “feat.” from album titles.

$set(album,$if(%_releasecomment%,%album% \($title(%_releasecomment%)\),%album%))

Add disambiguation into the album tag (first character in every word capitalized). Useful when we have several releases of the same album and want to somehow distinguish them:



obraz

My script is 99% complete (i think so). Only one thing left to do / improve. Link to the thread:

if anyone knows the solution, please let them write. I’m counting on you :wink: @Harakku did it. Thank you.

Last thing, if someone would like to have additional columns in the main window, like this:


check this topic:

I apologize for the lengthy reply and too many screenshots, but it should help beginners create them own dream script. Thank you once again for all your help.

EDIT1: added some little modifications and track numbers for Vinyl (A1, A2, B1…). More info above.

14 Likes

I like the script and using it…had to move the date to the beginning of the album folder name but that’s just how I organize, by date. Just a quick question…where did you get Additional Artists Variables plugin?

Plugin:

Thank you very much :slight_smile:

@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.