fix: an album with missing tracks is wanted back by its release group, not only when it carries a release MBID (#6167)
release / govulncheck (push) Successful in 17s
release / web (push) Successful in 1m24s
release / go (push) Successful in 1m32s
release / integration (push) Successful in 5m1s
release / android (push) Successful in 5m7s
release / Build signed APK (releases and dev) (push) Successful in 5m17s
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
release / govulncheck (push) Successful in 17s
release / web (push) Successful in 1m24s
release / go (push) Successful in 1m32s
release / integration (push) Successful in 5m1s
release / android (push) Successful in 5m7s
release / Build signed APK (releases and dev) (push) Successful in 5m17s
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
The release id was only ever used to find the group. 238 albums matched to a group carried none, so their losses, five of the resolver's wrong-slot removals among them, were never fetched again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,8 +21,11 @@ RETURNING *;
|
||||
-- * it still has at least one track whose file has been missing longer than
|
||||
-- the grace window. Measured on missing_since, which reconcile never
|
||||
-- re-stamps (#2523), so it is a genuine "gone since" clock;
|
||||
-- * MusicBrainz can name it: the album and its artist have MBIDs. Albums
|
||||
-- failing this are counted separately (CountAlbumsMissingWithoutMbid);
|
||||
-- * MusicBrainz can name it: the artist has an MBID, and the album a
|
||||
-- release MBID or a release group. The release MBID is only ever used to
|
||||
-- find the group, and 238 albums matched to a group carried no release
|
||||
-- id, so their losses were never wanted back (#6167). Albums failing this
|
||||
-- are counted separately (CountAlbumsMissingWithoutMbid);
|
||||
-- * it is on the wanted list (#5567): an album taken off the list, or
|
||||
-- dropped into the library by hand, is not fetched back;
|
||||
-- * no want already covers it: none open, and none held since its files
|
||||
@@ -41,7 +44,7 @@ SELECT albums.id AS album_id,
|
||||
JOIN tracks ON tracks.album_id = albums.id
|
||||
WHERE tracks.missing_since IS NOT NULL
|
||||
AND tracks.missing_since <= now() - make_interval(hours => sqlc.arg(grace_hours)::int)
|
||||
AND albums.mbid IS NOT NULL
|
||||
AND (albums.mbid IS NOT NULL OR albums.release_group_mbid IS NOT NULL)
|
||||
AND artists.mbid IS NOT NULL
|
||||
GROUP BY albums.id, albums.title, albums.mbid, albums.release_group_mbid,
|
||||
artists.name, artists.mbid
|
||||
@@ -64,7 +67,7 @@ SELECT COUNT(DISTINCT albums.id)::bigint
|
||||
JOIN artists ON artists.id = albums.artist_id
|
||||
JOIN tracks ON tracks.album_id = albums.id
|
||||
WHERE tracks.missing_since IS NOT NULL
|
||||
AND (albums.mbid IS NULL OR artists.mbid IS NULL);
|
||||
AND ((albums.mbid IS NULL AND albums.release_group_mbid IS NULL) OR artists.mbid IS NULL);
|
||||
|
||||
-- name: WantMissingAlbum :one
|
||||
-- Records an album with missing files as wanted. A held want for the same
|
||||
|
||||
Reference in New Issue
Block a user