#1555 - Stop-gap: drop MusicBrainz IDs when artist name and MBID counts differ#1556
Merged
michaelherger merged 1 commit intoApr 15, 2026
Conversation
Closed
9 tasks
0dbbb98 to
6e40c98
Compare
michaelherger
requested changes
Apr 15, 2026
Member
michaelherger
left a comment
There was a problem hiding this comment.
Looking good to me. Just minor tweaks below. Thanks!
…and MBID counts differ Slim::Schema::Contributor::add splits the artist name tag and the MusicBrainz ID tag independently and zips them positionally. When the lists differ in length (e.g. a joined-display "Artist A & Artist B" with 2 MBIDs, or "Artist A ft. Artist B" with 1 name and 2 MBIDs), the first MBID was bound to a joined-display name, poisoning the contributors row. Subsequent tracks whose MBID matched that row then inherited the wrong display name (see also the earlier report in LMS-Community#1052). Guard against the mismatch and drop the ambiguous MBIDs so the row is created without an MBID binding. Aligned Picard-convention tags are unaffected. Already-poisoned libraries need a wipecache. This is a defensive stop-gap, not a structural fix. Issue LMS-Community#1555 remains open: the proper resolution is to read the plural ARTISTS / ALBUMARTISTS Picard tags as the indexing source of truth, which will be a separate follow-up. Signed-off-by: Rouzax <GitHub@mgdn.nl>
6e40c98 to
43d558d
Compare
Contributor
Author
|
Thanks! Both changes done in the updated commit:
|
Member
|
Are you a bot? Or using one to generate all this textual content? |
michaelherger
approved these changes
Apr 15, 2026
Member
michaelherger
left a comment
There was a problem hiding this comment.
Thanks!
The other PR will take a little more time to review, as you can imagine.
Contributor
Author
I'm a human but Running Claude Code to create these fixes 😄, so a bit of both |
Contributor
|
I know this is merged, but I have reservations: see https://forums.lyrion.org/forum/user-forums/ripping-encoding-transcoding-tagging/1816764-lms-metadata-scaan-overrides-local-tags?p=1819451#post1819451 |
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.
Summary
Stop-gap mitigation for #1555 (and the earlier #1052, same root cause). Does not close the issue. The structural fix is a separate follow-up.
Slim::Schema::Contributor::addsplits the artist-name tag and the MusicBrainz-ID tag independently, then zips them positionally without checking that the lengths match. When they don't, the first MBID gets silently bound to a joined-display name (e.g."Artist A & Artist B"with 2 MBIDs, or"Artist A ft. Artist B"with 1 name aftersplitTagbut 2 MBIDs). That poisons thecontributorsrow, and any later track whose MBID matches that row inherits the wrong display name.This patch adds a length-mismatch guard: when the MBID count and the name count don't agree, the MBIDs are dropped for that call and the contributor row is created without an MBID binding. A single
INFOlog line in thescan.scannercategory makes the condition diagnosable.Scope: stop-gap, not a fix
This is the minimal defensive guard so existing libraries stop getting poisoned during scan. The proper resolution is to read the plural
ARTISTS/ALBUMARTISTSPicard tags as the indexing source of truth (using them forcontributorsrows and indexing while keepingARTIST/ALBUMARTISTfor display). That work is structural and will be a separate PR / RFC. Issue #1555 should remain open until that lands.Behavior
ARTIST,ALBUMARTIST,TRACKARTIST,COMPOSER, user-defined) sinceContributor::addis role-agnostic.Already-affected libraries
Users whose library already contains a poisoned contributor row need to run
wipecacheafter upgrading for the fix to take effect on existing data. Without that, the existing bad row stays in the DB until its tracks are removed.Verification
The reproduction zip from the issue (two 2-second silent Opus files) was scanned end-to-end on a clean LMS instance, both before and after this patch. Direct DB inspection of the resulting
contributorsandcontributor_albumrows:Martin Garrix & Alesso3e1f2ee4-...(Martin Garrix's MBID, POISONED)Martin Garrix3e1f2ee4-...(correct)Test Solo Albumdisplayed underMartin Garrix & Alesso(BUG)Martin Garrixwith correct MBIDThe follow-up reproduction in the issue comments (
ARTIST = "Armin van Buuren ft. Anne Gudrun"with 2 MBIDs against theARTISTrole) is the same length-mismatch class and is also addressed by this guard.No automated tests exist for
Schema::Contributor, so verification is manual.t/00_smoketest.shandt/verifyStrings.plremain green; no strings or schema were touched.Notes
scan.scanneralready present in this file (used byrescan()).Slim::Music::Info::splitTagor thesplitListpreference.