Conversation
There was a problem hiding this comment.
We are trying to keep the plugin logic separate from core logic. Therefore, I think we should not add this logic here, at-least not in the current musicbrainz specific form.
Shouldn't it be possible to use the duplicate_keys configuration option for this?
|
You’re right. I overlooked that duplicate_keys can include mb_albumid and that an existing album must match all configured fields. I downgraded to the unpatched beets package and tested both original reproductions after configuring: duplicate_keys: Both the Santana and Weezer directory imports completed without false duplicate prompts. I focused too narrowly on the default albumartist album query and incorrectly treated it as fixed importer policy rather than a configurable choice. The omission of mb_releasegroupid from as-is album aggregation also led me in the wrong direction, but that field is not needed for this use case because mb_albumid is already preserved. Thanks for pointing me to the intended mechanism. I’ll close this PR since the core change is unnecessary. This is exactly why code review is valuable. The existing configuration mechanism is a better solution than adding special-case logic to core. |
|
No worries! Feel free to make an addition to the docs if it is not entirely clear! |
Description
Fixes #7026.
Prevent album imports from treating distinct MusicBrainz releases as duplicates solely because their album artist and title match.
Duplicate candidates now compare MusicBrainz identifiers in order of specificity:
duplicate_keysbehavior.Release IDs take precedence over release-group IDs. This permits multiple pressings, remasters, regional editions, or deluxe editions from the same release group to coexist in a library.
As-is metadata aggregation now preserves
mb_releasegroupid, allowing this logic to work withbeet import -A.Regression tests cover matching and conflicting release IDs, matching and conflicting release-group IDs, different releases within the same release group, and fallback behavior when comparable identifiers are unavailable.
The packaged fix was also tested through COPR against the original real-world cases:
Both manual tests used
beet import -Aagainst an existing library.To Do
Documentation—not required because this fixes existing duplicate-detection behavior without changing the command-line interface.