Tagger script not executing automatically

i have a tagger script that does a few things and some of those lines do get run but the others don’t or at least not all the time. I usually have to run the script manually to be certain that it ran.

The line that isn’t running unless I do it manually is this

$if(%composer%,,$set(composer,$if2(%lyricist%,%writer%,%arranger%)))

I’ve also tested this alternate version

$set(composer,$if2(%composer%,%lyricist%,%writer%,%arranger%)

and while it ran it was taking the composer value from the files’ original metadata even though it wasn’t set on my preserve list

i think the tagger script is running automatically but it’s not running on the new metadata fetched by musicbrainz. Instead, it’s running on the the original metadata.

That’s why this line

$if(%composer%,,$set(composer,$if2(%lyricist%,%writer%,%arranger%)))

appears to do nothing. Some of those files have composer data in their original metadata and the tagger script is running based on that original data, but when i run it manually the script runs based on the musicbrainz fetched data

The tagger script does run automatically, but when it runs per-file, it can still see the file’s original tags as a fallback for any value that MusicBrainz didn’t provide.
So if your file already has a composer tag, $if(%composer%,,...) sees it as non-empty, even though it didn’t come from MusicBrainz.

That’s confusing, I agree.

I created a ticket: https://tickets.metabrainz.org/browse/PICARD-3378

2 Likes

We added 2 tagger script functions: $get_new() and $get_original()

So it is now possible to write:

$if($get_new(composer),,$set(composer,$if2(%lyricist%,%writer%,%arranger%)))

Documentation will be updated soon.
Those will be available in next Picard 3 release (>3.0.0b9).

2 Likes