fix: an album holding every track of an edition, and more besides, is that release group (M502 #5569)
release / govulncheck (push) Successful in 16s
release / web (push) Successful in 1m19s
release / go (push) Successful in 1m40s
release / integration (push) Successful in 5m15s
release / android (push) Successful in 5m23s
release / Build signed APK (releases and dev) (push) Successful in 5m30s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 16s
release / Verify release artifacts (tag releases only) (push) Skipped

Savant's "Void" folder holds all 23 tracks of the VOID (DLC) edition plus
20 more, and was refused at 23 of 43. A whole edition of three or more
tracks now matches whatever else the folder holds; singles and two-track
releases still need most of the album's tracks, since many albums hold
their songs. Matcher version 4 retries the refusals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-10 18:14:56 -04:00
co-authored by Claude Opus 5.5
parent 1936fe77c6
commit 7ef1fca90c
3 changed files with 14 additions and 7 deletions
+8 -5
View File
@@ -170,9 +170,12 @@ func minutes(ms int) string {
return fmt.Sprintf("%d:%02d", sec/60, sec%60)
}
// agrees: enough of the album's tracks agree for the edition to be it.
func agrees(n, tracks int) bool {
return tracks > 0 && n*10 >= tracks*matchAgreement
// agrees: enough of the album's tracks agree for the edition to be it, or
// the album holds every track of the edition and more besides (a folder
// with the deluxe edition and its demos). A single or a two-track release
// is not taken on containment: too many albums hold its songs.
func agrees(n, tracks, edition int) bool {
return tracks > 0 && (n*10 >= tracks*matchAgreement || (edition >= 3 && n == edition))
}
// sameTitle: the same words, not merely one holding the other. "And",
@@ -243,7 +246,7 @@ func (s *Service) matchAlbum(ctx context.Context, a dbq.ListAlbumsToMatchRow, tr
if err := check(discography); err != nil {
return albumMatch{}, err
}
if !agrees(bestN, len(tracks)) {
if !agrees(bestN, len(tracks), bestEdition) {
found, err := s.searchCandidates(ctx, a)
if err != nil {
return albumMatch{}, err
@@ -252,7 +255,7 @@ func (s *Service) matchAlbum(ctx context.Context, a dbq.ListAlbumsToMatchRow, tr
return albumMatch{}, err
}
}
if agrees(bestN, len(tracks)) {
if agrees(bestN, len(tracks), bestEdition) {
best.OK = true
return best, nil
}