In Generate Cuesheet plug musicbrainz_album is empty?

I’ve been trying to use the Generate Cuesheet plug-in that is on the standard list of plug-ins.
It creates a .cue file, but one line of the generated file is missing a value for MUSICBRAINZ_ALBUM_ID.

The snipit of code is below

t.set(“PERFORMER”, album.metadata[“albumartist”])
t.set(“TITLE”, album.metadata[“album”])
t.set(“REM”, “MUSICBRAINZ_ALBUM_ID”, album.metadata[“musicbrainz_albumid”])
t.set(“REM”, “MUSICBRAINZ_ALBUM_ARTIST_ID”, album.metadata[“musicbrainz_albumartistid”])
if “date” in album.metadata:
t.set(“REM”, “DATE”, album.metadata[“date”])

The output created for one particular CD is:

PERFORMER “Simon & Garfunkel”
TITLE “Live 1969”
REM MUSICBRAIN_ALBUM_ID
REM MUSICBRAIN_ALBUM_ARTIST_ID 5d02f264-e225-41ff-83f7-d9b1f0b1874a
REM DATE 2008

so, it appears the album.metadata[musicbrainz_albumid] has no value set.

The viewvariables plug-in shows the correct value for musicbrainz_albumid

I’m running Picard 2.8.5. Any ideas what is wrong?

Thanks

Do you have any scripts that change or unset musicbrainz_albumid?

Thanks, I had a one-line script:

$set(musicbrainz_albumid,%comment%)

I removed it and now Generate Cuesheet works:

TITLE “Live 1969”
REM MUSICBRAINZ_ALBUM_ID dbd910e8-b450-41b3-9fc7-7e9273259d0d
REM MUSICBRAINZ_ALBUM_ARTIST_ID 5d02f264-e225-41ff-83f7-d9b1f0b1874a
REM DATE 2008

Please can you explain why?

My guess is that the comment was blank for that release, so your one-line script was overwriting musicbrainz_albumid with an empty string. If you want to keep the one-liner, you should change it to:

$set(musicbrainz_albumid,$if2(%musicbrainz_albumid%,%comment%))
2 Likes

Any reason why you set the album ID to comment?

In the best case that will set the album ID to an empty value, causing Picard not to store the ID in the tags. One implication of that is that when you load the files again into Picard they won’t get automatically loaded to the proper release.

Worst case is the comment is actually set to something (but not the release ID). Then the value might break some software expecting an MBID in this tag.

1 Like

Hi
comment has a value, and both versions of the script break Generate Cuesheet. I notice that in Picard, when I click on the album, musicbrainz_albumid is not listed, but musicbrainz_releaseid is shown:

could this be related?

I tried your fix, it still breaks the Generate Cuesheet plug-in. comment is not empty anyway.

It was part of a hack, suggested by @dashv

I don’t understand this. If comment has a value, then it will set the ID?

Yes, understood. Just a hack for now.

I control its setting and I understand your concerns, but for now comment is not empty and looking at the output of viewvariables, %musicbrainz_albumid% has a value, but nothing is output… Is it related?

A correction, I think this was the problem.

I changed the comment back to a normal value - REM COMMENT “ExactAudioCopy v1.6”
with the original script:

$set(musicbrainz_albumid,%comment%)
Generate Cuesheet failed as first described.

with the fix

$set(musicbrainz_albumid,$if2(%musicbrainz_albumid%,%comment%))

It works. So, thanks for the fix. Note that in both scenarios above comment has a value. So musicbrainz_albumid would have had a value. Is there a version of viewscript variables at the album level?

The problem with your original script is that the comment is always empty for data loaded from MusicBrainz. Internally Picard has metadata on both the album and the track level.When this gets freshly loaded from MB there is no comment, so your script was clearing the album ID both on album and track level.

Only when a file with existing comment gets attached to the track then musicbrainz_album_id will have a value again. However, this does not heal the value on album level, but that’s what the cursheet module writes.

No, that only works on track / file level currently.

3 Likes

Thanks to you and @rdswift for your quick help and the explanation!

3 Likes