feat: Minstrel stops acquiring music and drops Discover
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

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>
This commit is contained in:
2026-11-21 20:51:14 -05:00
co-authored by Claude Opus 5.5
parent dabe1e052d
commit 55c7497ca7
277 changed files with 521 additions and 40021 deletions
-93
View File
@@ -53,99 +53,6 @@ func wantInbox(t *testing.T, who string, got []inboxItem, kinds ...notifications
}
}
func TestNotify_NewRequestReachesOtherAdminsOnce(t *testing.T) {
h, pool := testHandlers(t)
resetRequests(t, h)
alice := seedUser(t, pool, "np-alice", "pw", false)
admin := seedUser(t, pool, "np-admin", "pw", true)
selfAdmin := seedUser(t, pool, "np-self", "pw", true)
rv := createArtistRequest(t, h, alice, "np-mbid-1", "Pending Band")
// The same request again dedups into the first and is not announced twice.
createArtistRequest(t, h, alice, "np-mbid-1", "Pending Band")
got := inboxOf(t, pool, admin)
wantInbox(t, "admin", got, notifications.KindRequestPending)
if got[0].Payload.RequestID != uuidToString(rv.ID) || got[0].Payload.Name != "Pending Band" || got[0].Payload.Actor != alice.Username {
t.Errorf("pending payload = %+v", got[0].Payload)
}
wantInbox(t, "requester", inboxOf(t, pool, alice))
// An admin's own request goes to the other admins, never back to them.
createArtistRequest(t, h, selfAdmin, "np-mbid-2", "Own Band")
wantInbox(t, "self-admin", inboxOf(t, pool, selfAdmin), notifications.KindRequestPending)
if n := len(inboxOf(t, pool, admin)); n != 2 {
t.Errorf("admin inbox = %d, want 2 (alice's and the self-admin's)", n)
}
}
func TestNotify_AutoApprovedRequestWaitsOnNobody(t *testing.T) {
h, _ := testHandlers(t)
resetRequests(t, h)
alice := seedUser(t, h.pool, "np-auto", "pw", false)
admin := seedUser(t, h.pool, "np-auto-admin", "pw", true)
if _, err := h.pool.Exec(context.Background(),
"UPDATE users SET auto_approve_requests = true WHERE id = $1", alice.ID); err != nil {
t.Fatalf("set auto_approve: %v", err)
}
alice, err := dbq.New(h.pool).GetUserByID(context.Background(), alice.ID)
if err != nil {
t.Fatalf("reload user: %v", err)
}
rv := createArtistRequest(t, h, alice, "np-auto-mbid", "Auto Band")
if rv.Status != "approved" {
t.Fatalf("status = %q, want approved — the stub should accept the add", rv.Status)
}
wantInbox(t, "admin", inboxOf(t, h.pool, admin))
wantInbox(t, "requester", inboxOf(t, h.pool, alice))
}
func TestNotify_DecisionsReachTheRequester(t *testing.T) {
h, _ := testHandlers(t)
resetRequests(t, h)
alice := seedUser(t, h.pool, "np-dec-alice", "pw", false)
admin := seedUser(t, h.pool, "np-dec-admin", "pw", true)
approved := seedPendingArtistRequest(t, h, alice, "np-dec-1", "Yes Band")
rejected := seedPendingArtistRequest(t, h, alice, "np-dec-2", "No Band")
own := seedPendingArtistRequest(t, h, admin, "np-dec-3", "Own Band")
for _, c := range []struct {
id string
verb string
body []byte
}{
{uuidToString(approved.ID), "approve", nil},
{uuidToString(rejected.ID), "reject", []byte(`{"notes":"Only a live bootleg exists"}`)},
{uuidToString(own.ID), "approve", nil},
} {
w := doAdminRequestReq(t, h, http.MethodPost, "/api/admin/requests/"+c.id+"/"+c.verb, c.body, admin)
if w.Code != http.StatusOK {
t.Fatalf("%s %s: status = %d; body = %s", c.verb, c.id, w.Code, w.Body.String())
}
}
got := inboxOf(t, h.pool, alice)
wantInbox(t, "requester", got, notifications.KindRequestRejected, notifications.KindRequestApproved)
if got[0].Payload.Name != "No Band" || got[0].Payload.Reason != "Only a live bootleg exists" {
t.Errorf("rejected payload = %+v", got[0].Payload)
}
if got[1].Payload.Name != "Yes Band" || got[1].Payload.Reason != "" {
t.Errorf("approved payload = %+v", got[1].Payload)
}
// The admin decided their own request: no notice. alice's two pending
// notices are all the admin holds.
for _, it := range inboxOf(t, h.pool, admin) {
if it.Kind != string(notifications.KindRequestPending) {
t.Errorf("admin inbox holds %q, want only request_pending", it.Kind)
}
}
}
func TestNotify_FlagReachesAdminsButNotTheFlagger(t *testing.T) {
h, pool := testHandlers(t)
truncateLibrary(t, pool)