Repository for neat file name string patterns and tagger script snippets

picard
taggerscript
examples
Tags: #<Tag:0x00007ff3b53c9aa0> #<Tag:0x00007ff3b53c9938> #<Tag:0x00007ff3b53c9758>

#22

Looks good.
What bugs do you still have? Any idea when you will fix them?


#23

If you are talking about my script, I haven’t noticed any bugs.
But please report any and I will attempt to fix it.
I just wanted to create a script that people can customize to their liking at the very bottom.
Please note that all options should be set to 1 or 2, anything else will mess things up.

Edit: I added that into the script noop.

2nd Edit: I noticed a very minor error and I will fix it tomorrow.


#24

You mean something like this:

$replace($rreplace(
   $if($eq(%albumartist%,Various Artists), [Various Artists],
	    $if($eq(%albumartist%,[unknown]), [Unknown],
          $left($rreplace($if2(%albumartistsort%,%artistsort%),; [^\)]+,), 60))
)
/
$if(%date%,[$left(%date%,4)] )$left($replace(%album%,/,), 70)
/
$if($gt(%totaldiscs%,1),$if(%discnumber%, $num(%discnumber%,2)-),)
$num(%tracknumber%,2). $left(%title%,120),[:?"_]+,),  , )

#25

Here’s the updated version. Fixed a very minor error.

$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(Artist1,$replace($rreplace(%albumartist%,[_:*?"<>|],-),?,)/)
			$set(Artist2,$replace($rreplace(%albumartistsort%,[_:*?"<>|],-),?,)/)
			$set(Album1,$replace($rreplace(%album%,[_:*?"<>|], -),?,)$if(%date%,$if(%album%, )[$left(%date%,4)])/)
			$set(Album2,$replace($rreplace(%album%,[_:*?"<>|], -),?,)/)
			$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(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 *** )
$noop( *** Default output: -=A =-/Amy Winehouse/Back to Black [2007]/Disc 1/Amy Winehouse - Back to Black - 01 - Rehab *** )
$noop( *** Change the NUMERICAL value ONLY! Example: %MainFolder1% would be changed to %MainFolder2% *** )
$noop( *** 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 = 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. )

Looking for the ultimate renaming script!
#26

How do you deal with naming when you have albums which are different editions/versions? For me the album names are the same, so it tried to put all the files into the same folder.


#27

The way I do it here is to include the release date in the directory naming scheme.


#28

Yeah I did that for a while, but wasn’t sure that would satisfy software that only read file name to determine versions. So I was thinking of baking everything in to the file name, but that gets ugly - especially if you start putting dates into it.


#29

I use _releasecomments to get the disambiguation note. Also, I add Single and EP to the release folder if appropriate. That way the Hounds of Love album is in a folder called “Hounds of Love” while the single is “Hounds of Love (Single)”.


#30

Piz:

I know this post is a couple years old, but I just recently copied and fairly significantly tweaked it to meet my needs. Something i’m struggling with is the above $set command. If I’m understanding it correctly, isn’t that command supposed to be “writing” the value of _artist back to the actual artist tag of each track? I ask because I don’t see such an action happening when I save files with this file naming scripts running (using Picard 1.4.2). Same thing with:

I even tried changing both $set commands to string “TEST” just to see what would happen. No change in the actual tags of the resulting files.

I think I must be missing something. Either the purpose of the command or something else. I assume you have your entire script in the File Naming script window; though maybe that’s where I’ve gone wrong and need to have all or some of the script in the Scripts option window.

Thoughts?

Thanks,
lahueneke


#31

This is how script porn looks like for me. The details and how it’s set up reminded me of my own attempt of scripting except its complete, while mine is very much still a work in progress as I had no knowledge of programing when I began working on it.
The organization and ordnung is something my own ocd tendencies appreciate a lot, so I’m gonna read and re-read your script because I’m sure you have some great ways of doing it that I can incorporate in my own.
Thank you very much for sharing it!


#32

Here’s my naming script: https://pastebin.com/wWS3B3a1

Main features:

  • releases start with the originaldate unless it’s a live or or broadcast release whose name starts with a date, in which case no date, just the release name
  • “The” is moved to the end of the artist name, in a sort of “lite” sort name
  • pulls in release comments, or custom local “disambig” tags when naming the release
  • albums go directly under the artist, but other release types get sorted into subdirectories
  • audiobooks are split off separately

#33

Thanks all, especially those who added examples of the output: Seeing the scripting and output close together makes it much more understandable for my scripting illiteracy; I can’t do this sort of thing with my soldering iron! :wink:

That being said: If you are capable please add more, not because most scenarios aren’t already covered here, but seeing different variations, helps paint a more clear picture of how this all works.

I would say “you guys rock” but many of you pop and classical too!


#34

Thank you so much for this, I loved the flexibility of your script. I googled for few patterns and I found yours to be the most :ok_hand: for my needs. If you ever plan to expand your script, I could suggest:

  • Ability to manipulate folder name ([Year] Album Name / Album Name [Year])
  • Not sure if possible, but add filetype to the name of the album folder, I have a mix of flac/mp3 and I’m generally not bothered. Maybe one day, I’d love to upgrade my most beloved albums to FLAC, but finding those would be a pain!

#36
$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(Artist1,$replace($rreplace(%albumartist%,[_:*?"<>|],-),?,)/)
		$set(Artist2,$replace($rreplace(%albumartistsort%,[_:*?"<>|],-),?,)/)
		$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(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(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 *** )
$noop( *** Default output: -=A =-/Amy Winehouse/Back to Black [2007]/Disc 1/Amy Winehouse - Back to Black - 01 - Rehab *** )
$noop( *** Change the NUMERICAL value ONLY! Example: %MainFolder1% would be changed to %MainFolder2% *** )
$noop( *** 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. )

Added the option to have year in front of album name.


#37

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

#38

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


#39

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.