Append / Strip Out a Genre

This is a series of posts I’m putting up to support people using MusicBrainz Picard with Serento. It’s scripting functionality is a little daunting to start with but is incredibly powerful. You can create scripts which run either when you drop in an album to tag or to run manually. I will update these posts as my own scripts evolve.

Feel free to use these as a basis and make your own, or post any questions and I’ll be happy to help where and when I can!

You can create and edit scripts under OPTIONS > Scripting

If you tick the box next to the script the script will run automatically.

If you do not tick the box you select the files you want to run the script on, right click and go to RUN SCRIPTS > (name)

To Add a Genre

This script will append a genre (in this case “Soundtrack”) to the list of genres and make sure they are all then alphabetically sorted.

$set(__new_genre,Soundtrack)
$setmulti(genre,$unique($sortmulti(%genre%; %__new_genre%)))
$cleanmulti(genre)

To Remove a Genre

This script will remove a genre (in this case “Hip Hop”) from the list of genres.

$set(__bad_genre,Hip Hop)
$if($inmulti(%genre%,%__bad_genre%),$setmulti(genre,$map(%genre%,$if($eq(%_loop_value%,%__bad_genre%),,%_loop_value%))))