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:
@@ -297,7 +297,7 @@ type ListGrabsRow struct {
|
||||
|
||||
// The Wanted view's Activity tab: downloads waiting on a person first, then
|
||||
// the rest still running, then the ended ones newest first. Each carries
|
||||
// what is wrong with it now, if anything (#5523).
|
||||
// what is wrong with it now, if anything.
|
||||
func (q *Queries) ListGrabs(ctx context.Context, arg ListGrabsParams) ([]ListGrabsRow, error) {
|
||||
rows, err := q.db.Query(ctx, listGrabs, arg.Skip, arg.MaxRows)
|
||||
if err != nil {
|
||||
@@ -366,7 +366,7 @@ type ListImportedGrabsHoldingRow struct {
|
||||
|
||||
// The downloads Minstrel imported into the folder holding path: the releases a
|
||||
// file there came from, to block when the files proved not to be the album
|
||||
// (#6169). A file imported before Minstrel downloaded anything has none.
|
||||
// . A file imported before Minstrel downloaded anything has none.
|
||||
func (q *Queries) ListImportedGrabsHolding(ctx context.Context, path string) ([]ListImportedGrabsHoldingRow, error) {
|
||||
rows, err := q.db.Query(ctx, listImportedGrabsHolding, path)
|
||||
if err != nil {
|
||||
@@ -441,7 +441,7 @@ type ListLiveGrabsRow struct {
|
||||
WantAlbumID pgtype.UUID
|
||||
}
|
||||
|
||||
// Import with verification (M502 #5522).
|
||||
// Import with verification.
|
||||
// Every download still running or waiting on its import, oldest first.
|
||||
func (q *Queries) ListLiveGrabs(ctx context.Context) ([]ListLiveGrabsRow, error) {
|
||||
rows, err := q.db.Query(ctx, listLiveGrabs)
|
||||
@@ -574,7 +574,7 @@ type ListUpgradeTracksRow struct {
|
||||
SourceVerdict *string
|
||||
}
|
||||
|
||||
// The tracks an upgrade may replace (#5524): the present tracks of the album
|
||||
// The tracks an upgrade may replace: the present tracks of the album
|
||||
// the want holds.
|
||||
func (q *Queries) ListUpgradeTracks(ctx context.Context, albumID pgtype.UUID) ([]ListUpgradeTracksRow, error) {
|
||||
rows, err := q.db.Query(ctx, listUpgradeTracks, albumID)
|
||||
@@ -694,7 +694,7 @@ UPDATE grabs
|
||||
import_forced = false,
|
||||
imported_at = CASE WHEN $1::text = 'imported' THEN now() ELSE imported_at END,
|
||||
-- The files were copied, so an imported download goes on sharing
|
||||
-- until the lifecycle removes it (#5523).
|
||||
-- until the lifecycle removes it.
|
||||
seeding = $1::text = 'imported',
|
||||
imported_files = $4,
|
||||
destination = $5,
|
||||
|
||||
Reference in New Issue
Block a user