[Picard 2.3] Check if genre is empty doesn't work anymore?

According to this thread, the scripting line

$if($not(%genre%),$set(genre,***** UNSET *****))

should check if a genre tag is not empty. Otherwise it should fill the genre tag with the UNSET info text.
Im pretty sure this worked fine until Picard 2.3.

In the latest Picard 2.3, this seems not to work anymore. Even if a genre contains “Rock” or “Black Metal”, the text “***** UNSET *****” will be filled in the gerne tag.

Could please someone check this?
If this is not a problem in my environment, I will open a ticket on JIRA.

For the files you tested this on, where the genre tags only present in the files themselves, or are they offered by MusicBrainz?

If I am not mistaken, in the first case Picard won’t be able to check that.

Yes, the genre is already stored in the file.
Do you have an idea, why Picard shouldn’t be able to check such genres?

No, all I seem to remember is that it is a current limitation.
I’ve been looking for some way to achieve the same, but haven’t succeeded yet.

It’s not specifically about genres but in general about the tags in the file. The scripts get executed for data loaded from MusicBrainz. At that point there are no files available. If you later match a file to the loaded data the script does not run again. There have been attempts to change that, e.g. the 2.0 release had a patch to change that. But it got reverted die to side effects. This is one of the top requested features and I hope we can address this in one of the next releases.

The current workaround is to run the script manually instead.


Should it work If I right click the album on the right side and execute a script with only above single line?
In my tests, I can’t get it working with this workaround :sleepy: :woozy_face:

Yes, and that definitely works for me. Are you sure there is no genre set? Depending on your configuration a genre likely got set by Picard.

I’m sure the error lies between my chair and my screen:

I just don’t understand what I’m doing wrong:

If I do the same steps with the same album WITHOUT genre set (the genre tag doesn’t exist), the script works fine.

1 Like

You are actually right, that doesn’t work on the tracks indeed. Actually this is part of the file script issue. The metadatabox on the bottom shows a combined view of data set for the file and for the track, but the scripting operates on the track metadata only :frowning:


Thanks for your explanation @outsidecontext !
(At least, I’m not a complete idiot.)

Does it help if I create a ticket for this issue?
Or do we have already a ticket and this thread can be linked to it?

There is the following ticket and related ones:

1 Like