Repository navigation
Qobuz returns invalid UPC with missing check digit #228
Description
Activity
This does seem like more of a distribution issue than anything else, but the fact that Qobuz doesn't prevent this from happening should at least be flagged with a warning on affected releases
To be more specific, this issue is encountered on much older Qobuz releases where the UPC is also the release ID visible on the URL. Never used that platform outside of MB edits, but AFAIK they phased out this practice sometime post-2020 when they started assigning their internal alphanumeric IDs to newer releases (e.g. a33iif5nrzotc). Personally, I don't remember encountering the problem on releases that came out after this change took place.
Being an issue tied to older media and an outdated practice, I don't expect fixing this to be among Qobuz's priorities. Then again, calculating the missing check digit is simple maths which I believe Harmony can handle.Reacted by Lioncat6The math is actually already done for validation.
Big problem: it is possible that such mishandled GTIN passes validation (
00602517040106->0060251704010, both valid).So, solving with that in mind adds a lot more problems:
- Should GTINs not found on other platforms be retried with a check digit added? (With cutoff on some date, or at least on numeric IDs only, it's pointless to check on new releases.)
- Lookup by GTIN doesn't work with affected albums - should it also be tried with the check digit truncated? (Cutoff on some date.)
- Conflict resolution ("Providers have returned multiple different GTIN: 602527630601 (MusicBrainz), 60252763060 (Qobuz)").
Alternatively, hacks:
quirk_qobuz_truncated_gtin=1in query adds a check digit, error: "Qobuz returned invalid GTIN, retry with recalculated check digit?", warning: "This GTIN is only on Qobuz, might be invalid: is this Tidal release the same?"Qobuz's URL format changed in December 2017, IIRC.
I've found Harmony never finds a Qobuz release if the barcode is 14 digits. I either need to drop the last digit (old URL format) or the first one (new URL format).
Reacted by Deniz8891 and David KellnerSo, if I correctly understand this issue, the problem is two-fold:
- Qobuz returns 13 digit barcodes, which may be 14 digit GTIN with a missing check digit for older releases. We can handle this by appending a check digit if the checksum is wrong (only inside the Qobuz provider). This is what fix(Qobuz): restore missing GTIN check digits #236 does and should work except for the edge case of 14 digit barcodes which are valid 13 digit codes even without the original check digit.
An alternative approach which could handle that would be to always append a check digit to the 13 digit barcode if it is the same as the ID from the URL. Or do URLs exist where the ID already is the correct barcode with check digit? - Qobuz barcode lookup does not work with 14 digit barcodes. It only ever accepts 13 digit barcodes? We could handle that by formatting the incoming barcode (from the UI or another provider) to 13 digits. That doesn't cover cases where Qobuz expects an invalid barcode without check digit.
These could still be found by initiating the lookup with a Qobuz URL at least. Alternatively we could also try that invalid barcode as a backup if the correct 13 digit barcode was not found (similar to the Spotify provider which also tries different barcode lengths).
- Qobuz returns 13 digit barcodes, which may be 14 digit GTIN with a missing check digit for older releases. We can handle this by appending a check digit if the checksum is wrong (only inside the Qobuz provider). This is what fix(Qobuz): restore missing GTIN check digits #236 does and should work except for the edge case of 14 digit barcodes which are valid 13 digit codes even without the original check digit.
Or do URLs exist where the ID already is the correct barcode with check digit?
We definitely have such cases too:
https://harmony.pulsewidth.org.uk/release?qobuz=3298499022307®ion=GB&ts=1785602124
https://musicbrainz.org/release/4beca6ae-99b0-4b5b-971e-5b152efd1de5Reacted by David KellnerI'm getting invalid GTIN errors when trying to look up https://www.qobuz.com/us-en/album/reveal-rem/0088807239620 and https://www.qobuz.com/us-en/album/in-time-the-best-of-rem-1988-2003-rem/0088807200373. The full barcodes are 00888072396203 and 00888072003736 respectively.
@ComradeMike Really? That it is supposed to be fixed with v2026.8.9.
When I try the first link, the missing check digit is added as expected: https://harmony.pulsewidth.org.uk/release?qobuz=0088807239620®ion=US&ts=1787420223
The second link is unfortunately one of those cases where the 13 digit code without the check digit is a valid GTIN-13 and it is not possible to detect that it should be a GTIN-14.
https://harmony.pulsewidth.org.uk/release?url=https%3A%2F%2Fwww.qobuz.com%2Fgb-en%2Falbum%2Fbuild-me-up-from-bones-sarah-jarosz%2F0001589171735>in®ion=GB%2CUS%2CDE%2CJP&qobuz
The above is not an isolated case because for all the time I've been adding Qobuz release links manually, I kept seeing this on older Qobuz releases where the UPC is incorporated into the URL (before they introduced their own native release IDs).
If you try to submit it, MB will immediately report the invalid barcode. You'll have to manually add the missing check digit 7 at the end.
Furthermore, the current limitation prevents such Qobuz links to get harmonized with equivalents on other vendors for the same release in question.
https://harmony.pulsewidth.org.uk/release?url=https%3A%2F%2Fmora.jp%2Fpackage%2F43000006%2F00015891717357%2F>in®ion=US&ototoy=156359&deezer&spotify&tidal=21989366&qobuz=0001589171735&beatport