fix: same-titled albums of two release groups are two albums, and a missing track with no disc is on disc 1
release / govulncheck (push) Successful in 16s
release / web (push) Successful in 1m23s
release / go (push) Successful in 1m30s
release / integration (push) Successful in 5m0s
release / android (push) Successful in 5m1s
release / Build signed APK (releases and dev) (push) Successful in 5m9s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 29s
release / Verify release artifacts (tag releases only) (push) Skipped

The scanner found an album by artist and title alone, so Weezer's six
self-titled albums (1994–2026) were one 118-track row and their merges,
wants and upgrades counted them as one. A same-named row whose release group
is known and differs from the file's is now another album; tagReadVersion 7
re-reads the library so existing tracks move to their own rows.

WantHoldings compared discs with IS NOT DISTINCT FROM, so a missing track 6
with no disc was never covered by a present disc 1 track 6. Air's Love 2
stayed wanted and was downloaded again for nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-20 14:13:58 -04:00
co-authored by Claude Opus 5.5
parent f32abc974f
commit e45561e282
7 changed files with 173 additions and 13 deletions
+11 -2
View File
@@ -74,7 +74,11 @@ var audioExtensions = map[string]bool{
// dhowden/tag reads it as 0, and Minstrel's own importer wrote it that
// way, so all 245 FLAC tracks it imported came in with no track or disc
// number and their albums lost their order.
const tagReadVersion int16 = 6
// 7: an album of the same name in another release group gets its own row
// (resolveAlbum). Weezer's six self-titled albums were one 118-track row,
// so their merges, wants and upgrades all counted as one album; a re-read
// files each existing track under its own album.
const tagReadVersion int16 = 7
type Stats struct {
Scanned int `json:"scanned"`
@@ -562,7 +566,12 @@ func (s *Scanner) resolveArtist(ctx context.Context, q *dbq.Queries, name, mbid
}
func (s *Scanner) resolveAlbum(ctx context.Context, q *dbq.Queries, artistID pgtype.UUID, title string, year int, mbid, releaseGroupMBID string) (dbq.Album, error) {
existing, err := q.GetAlbumByArtistAndTitle(ctx, dbq.GetAlbumByArtistAndTitleParams{ArtistID: artistID, Title: title})
lookup := dbq.GetAlbumByArtistAndTitleParams{ArtistID: artistID, Title: title}
if releaseGroupMBID != "" {
rg := releaseGroupMBID
lookup.ReleaseGroupMbid = &rg
}
existing, err := q.GetAlbumByArtistAndTitle(ctx, lookup)
if err == nil {
// Heal the release group the same way. Not unique, so no conflict to
// handle: every release of a group may carry it.