docs: query comments say what each query selects and why, not how it came to be (#6277)
Rewrites the internal/db/queries comments to rule 32 and regenerates dbq, whose doc comments and embedded SQL carry them. The bugs behind the tiered mixes, the md5 order seed, the score bands and the round-robin arms are restated as the constraint each one enforces; counts from one library and stale cross-references are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
-- Re-acquisition of missing files (milestone #290, reworked for M502 #5520).
|
||||
-- Re-acquisition of missing files.
|
||||
-- The unit is the album: an album whose files went missing becomes a want for
|
||||
-- its release group, and the search schedule (#5521) looks for it.
|
||||
-- its release group, and the search schedule looks for it.
|
||||
|
||||
-- name: GetReacquisitionSettings :one
|
||||
SELECT * FROM reacquisition_settings WHERE id = true;
|
||||
@@ -20,17 +20,17 @@ 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;
|
||||
-- re-stamps, so it is a genuine "gone since" clock;
|
||||
-- * 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
|
||||
-- find the group, and an album matched to a group may carry no release
|
||||
-- id. Albums failing this are counted separately
|
||||
-- (CountAlbumsMissingWithoutMbid);
|
||||
-- * it is on the wanted list: 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
|
||||
-- went missing. A want held after the loss means the library has a full
|
||||
-- copy despite the missing rows (#5245), so asking again would loop.
|
||||
-- copy despite the missing rows, so asking again would loop.
|
||||
SELECT albums.id AS album_id,
|
||||
albums.title AS album_title,
|
||||
albums.mbid AS album_mbid,
|
||||
|
||||
Reference in New Issue
Block a user