Files
minstrel/internal/db/queries/catalogue.sql
T
bvandeusenandClaude Opus 5.5 55c7497ca7
release / go (push) Successful in 1m54s
release / web (push) Failing after 5s
release / integration (push) Failing after 3m44s
release / govulncheck (push) Successful in 20s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 19s
release / android (push) Canceled after 2m37s
feat: Minstrel stops acquiring music and drops Discover
Minstrel is now a viewer of the library it is pointed at. Finding,
downloading and filing music moves out of it.

Removed from the server:
- the request flow (requests, approval, auto-approve) and the wanted list,
  follows, release profiles and release blocks;
- searching indexers, the download clients, the importer, the album
  lifecycle and missing-file re-acquisition;
- the catalogue's discography, search and art (the MusicBrainz release and
  track-list cache stays, for the duplicate resolver);
- Discover: its suggestions of artists not in the library, snoozes, the
  candidate-artist tag enrichment and its tuning scope;
- writes to acquisition tables from moving the library folder and from
  merging duplicates, the want-list join on Suspect sources, the sealing of
  acquisition credentials, and the release-group lookup only
  re-acquisition used.

Settling a wrong-slot duplicate no longer sets the release aside: the
copies go and their slots show as missing until a good copy is in the
library.

Removed from the web: Admin > Acquisition and Requests, /requests,
/discover, Follow on the artist page, the auto-approve toggle, and the
Collection's wanted-list tabs. The Collection is now the library's health:
an overview, Reports, Duplicates, Suspect sources and Missing files. The
README and docs no longer describe getting music.

The tables stay for now; a later migration drops them. The request
notification kinds and the Android screens are still to go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:51:14 -05:00

55 lines
2.6 KiB
SQL

-- The release catalogue read from MusicBrainz.
-- name: UpsertMBReleaseGroup :exec
-- Leaves releases_refreshed_at alone: only a full read of the group's
-- releases and track lists marks it.
INSERT INTO mb_release_groups (mbid, title, primary_type, secondary_types, first_release_date, artist_credit)
VALUES (sqlc.arg(mbid), sqlc.arg(title), sqlc.arg(primary_type), sqlc.arg(secondary_types)::text[],
sqlc.arg(first_release_date), sqlc.arg(artist_credit))
ON CONFLICT (mbid) DO UPDATE SET
title = EXCLUDED.title,
primary_type = EXCLUDED.primary_type,
secondary_types = EXCLUDED.secondary_types,
first_release_date = EXCLUDED.first_release_date,
artist_credit = EXCLUDED.artist_credit,
updated_at = now();
-- name: GetMBReleaseGroup :one
SELECT * FROM mb_release_groups WHERE mbid = sqlc.arg(mbid);
-- name: MarkMBReleaseGroupReleasesRefreshed :exec
UPDATE mb_release_groups SET releases_refreshed_at = now() WHERE mbid = sqlc.arg(mbid);
-- name: DeleteMBReleasesForGroup :exec
-- Tracks go with their releases (ON DELETE CASCADE).
DELETE FROM mb_releases WHERE release_group_mbid = sqlc.arg(release_group_mbid);
-- name: InsertMBRelease :exec
INSERT INTO mb_releases (mbid, release_group_mbid, title, status, release_date, country,
disambiguation, formats, track_count)
VALUES (sqlc.arg(mbid), sqlc.arg(release_group_mbid), sqlc.arg(title), sqlc.arg(status),
sqlc.arg(release_date), sqlc.arg(country), sqlc.arg(disambiguation), sqlc.arg(formats),
sqlc.arg(track_count))
ON CONFLICT (mbid) DO UPDATE SET
release_group_mbid = EXCLUDED.release_group_mbid,
title = EXCLUDED.title,
status = EXCLUDED.status,
release_date = EXCLUDED.release_date,
country = EXCLUDED.country,
disambiguation = EXCLUDED.disambiguation,
formats = EXCLUDED.formats,
track_count = EXCLUDED.track_count;
-- name: InsertMBReleaseTrack :exec
INSERT INTO mb_release_tracks (release_mbid, medium_position, position, medium_format, number,
title, length_ms, recording_mbid)
VALUES (sqlc.arg(release_mbid), sqlc.arg(medium_position), sqlc.arg(position),
sqlc.arg(medium_format), sqlc.arg(number), sqlc.arg(title), sqlc.arg(length_ms),
sqlc.arg(recording_mbid));
-- name: ListMBReleaseTracksForGroup :many
SELECT t.* FROM mb_release_tracks t
JOIN mb_releases r ON r.mbid = t.release_mbid
WHERE r.release_group_mbid = sqlc.arg(release_group_mbid)
ORDER BY t.release_mbid, t.medium_position, t.position;