feat: a version named after a dash counts as a version, and a song held twice beside a wrong slot no longer blocks it (M498)
release / govulncheck (push) Successful in 25s
release / web (push) Successful in 1m22s
release / go (push) Successful in 1m31s
release / android (push) Successful in 4m51s
release / integration (push) Successful in 4m53s
release / Build signed APK (releases and dev) (push) Successful in 5m0s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 17s
release / Verify release artifacts (tag releases only) (push) Skipped

- songKey drops a dashed version suffix (" - Instrumental Version", " - Radio
  Edit", live, remix, mix, acoustic, demo, reprise, rework, VIP), so Andora's
  "Goodbye Yesterday - Instrumental Version" is distinct, not a wrong slot.
- wrongSlots accepts several fitting copies when they share one title
  (Killjoy twice beside Dreamland): the other slot's copy is removed, and the
  doubled song is left for the next sweep to find as a pair the resolver merges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-20 06:24:47 -04:00
co-authored by Claude Opus 5.5
parent 80c711ac9d
commit c5868c00cc
3 changed files with 31 additions and 7 deletions
+11 -3
View File
@@ -49,8 +49,15 @@ type slotCopy struct {
// wrongSlots decides which copies of a one-album mismatch sit in a slot that
// is not theirs. keep is the copy whose slot fits the recording; ok is false
// when the track list cannot say, and nothing should be removed.
//
// Several copies may fit when they carry the same title ("Killjoy" twice
// beside "Dreamland"): they are one song held twice, not a wrong slot, so they
// are neither kept nor lost here. Once the wrong slot is emptied, the next
// sweep finds the pair on its own, and the resolver merges it as any song held
// twice on one album.
func wrongSlots(copies []slotCopy, tracks []dbq.MbReleaseTrack) (keep int, losers []int, ok bool) {
keep = -1
keepKey := ""
for i, c := range copies {
key := MatchTitleKey(c.Title, c.Artist)
fits, other, known := false, true, false
@@ -68,11 +75,12 @@ func wrongSlots(copies []slotCopy, tracks []dbq.MbReleaseTrack) (keep int, loser
}
}
switch {
case fits:
if keep >= 0 {
case fits && keep >= 0:
if key != keepKey {
return -1, nil, false
}
keep = i
case fits:
keep, keepKey = i, key
case known && other:
losers = append(losers, i)
default: