Baby's first taggerscript: removing some old tags when no replacement?

so, as y’all may already know, I’ve been slowly organizing my 12-ish-year-old music library. as I’ve been going through it, I’ve found a lot of my Genre and Grouping tags are a bit of a mess… I’d like to remove any existing tags there, and replace with MusicBrainz genres (when they exist). out of the box, this works as long as there are genres to replace them, but when there aren’t any MB genres, it keeps the old tags. I also don’t want to clear all tags, because there are other old tags I want to keep intact without worrying that I missed adding an important tag or two to the list.

would this be a way to do this?



I’m using $unset() instead of $delete() since I still want to be able to get genres from MB and plugins and not have those instantly deleted. I also don’t know if I even need that first line (if it even works in scripts), since scripts automatically run when a track is moved to the right-hand pane, right? if not, I’d like it to do that if possible…

thank you for your help!~

1 Like

Taggerscripts have no ability to differentiate between a value that existed in your file vs. a value that was pulled down from the server. The only way you can get around this is if you define your local values in proprietary fields that Picard will never download a server value into.

Plugins and taggerscripts are different things, so file_post_addition_to_track_processor() is not a thing you can do in a taggerscript.

okay, so that means I’d need to remove all genres, save, then add genres from MusicBrainz, then save again? or maybe find a way to remove the genre only if it’s unchanged or something? that sounds too complicated for me, lol… I’ll likely just remove then add back…

I figured this likely was the case, but I figured it was worth asking about :wink: