docs(scanner): document artistIDMap many-to-one collapse behavior

Per Copilot review on PR #5527: the 'first prevID wins' check looked
like a bug. It is intentional but the rationale wasn't obvious from
context. Annotate the code with the merge-collision relationship to
ReassignAnnotation's missing merge semantics — the follow-up that
fixes the SQL side will benefit both album and artist re-PID paths.
This commit is contained in:
Deluan
2026-05-24 22:24:50 -03:00
parent c413d6510e
commit 4e7c2128f3
+9
View File
@@ -306,6 +306,15 @@ func (p *phaseFolders) loadTagsFromFiles(entry *folderEntry, toImport map[string
// Build artistIDMap: for each participant on this track, if the previous
// spec produces a different ID than the current one, record the mapping.
//
// The map is keyed by the new artist ID so it stores ONE previous ID per
// new ID, even when many old IDs collapse to the same new one (e.g.
// switching from "name" to "musicbrainz_artistid|name" where multiple
// name-keyed IDs share an MBID). This is intentional: ReassignAnnotation
// is idempotent and the other prior IDs orphan their annotations into
// the unique-constraint collision case documented in the spec — a
// known limitation tracked for a separate follow-up that fixes
// ReassignAnnotation merge semantics at the SQL level.
if p.prevArtistPIDConf != "" && p.prevArtistPIDConf != conf.Server.PID.Artist {
for _, list := range track.Participants {
for _, part := range list {