Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beatport requires barcodes to have the correct zero padding #63

Open
kellnerd opened this issue Oct 13, 2024 · 1 comment
Open

Beatport requires barcodes to have the correct zero padding #63

kellnerd opened this issue Oct 13, 2024 · 1 comment
Labels
Beatport bug Something isn't working

Comments

@kellnerd
Copy link
Owner

Originally reported on the forums by DenizC:

I’ve seen a few cases where Beatport releases won’t show up on permalinks even after they are found. Usually this occurs when you searched for a release with a link from one of the other platforms, a Beatport equivalent is found, but it won’t be kept for the permalink.

One recent example of mine: Search with Apple Music link
A Beatport release is found among equivalents in other platforms.
Clicking on the Permalink however, the Beatport release isn’t listed, with the red box above explicitly stating that it wasn’t found.

Interestingly, this doesn’t occur when using the Beatport link as the primary search parameter.

The problem is the zero-padding of the barcode, Beatport complains that it couldn’t find the barcode without the leading zero. I only spotted this because the primary source (iTunes and Bandcamp in your examples) has returned the barcode with a leading zero.
If I add the zero-padding to the permalink, it starts working again.

Beatport is yet another provider which doesn’t return search results if the barcode does not have the right amount of zeros :person_facepalming:
Together with the permalink generation, which chooses the encoded GTIN from an arbitrary provider (because in theory they should have the same value and each provider should be able to handle leading zeros) this leads to broken permalinks while the initial lookup worked because it used the GTIN from the primary provider which had the correct number of zeros (by chance).

Ideally the Beatport provider should try multiple barcodes, but Beatport searches are already slow enough as is, so I will probably try to make the permalink generation choose a “better suited” GTIN first, I guess.

@kellnerd kellnerd added bug Something isn't working Beatport labels Oct 13, 2024
@kellnerd kellnerd self-assigned this Oct 18, 2024
@kellnerd
Copy link
Owner Author

Ideally the Beatport provider should try multiple barcodes, but Beatport searches are already slow enough as is, so I will probably try to make the permalink generation choose a “better suited” GTIN first, I guess.

I improved the permalink generation in 48c6a0a, which solves the original issue report.

Contributions to make the GTIN search more robust are still welcome once we migrate from the slow HTML scraping approach to a hopefully faster API based implementation.

@kellnerd kellnerd removed their assignment Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Beatport bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant