fix(qobuz_importer): duplicate Qobuz discography MB icons - #1003
Merged
Conversation
Qobuz discography pages look up multiple URL aliases for the same entity, including localized www.qobuz.com URLs and open.qobuz.com URLs. When more than one alias resolves to the same MusicBrainz entity, the callback inserted the same MB icon multiple times before the same Qobuz link. Deduplicate inserted MB links by their target href before adding them to the discography item. This preserves multiple distinct MB matches while suppressing duplicate icons from equivalent Qobuz URL variants. Also avoid re-inserting search placeholders when an MB/search indicator already exists before the Qobuz link. Search placeholders are still removed when a real MB link is inserted, since the resolved icon replaces the fallback search link.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Qobuz discography pages look up multiple URL aliases for the same entity, including localized www.qobuz.com URLs and open.qobuz.com URLs. When more than one alias resolves to the same MusicBrainz entity, the callback inserted the same MB icon multiple times before the same Qobuz link.
Deduplicate inserted MB links by their target href before adding them to the discography item. This preserves multiple distinct MB matches while suppressing duplicate icons from equivalent Qobuz URL variants.
Also avoid re-inserting search placeholders when an MB/search indicator already exists before the Qobuz link. Search placeholders are still removed when a real MB link is inserted, since the resolved icon replaces the fallback search link.