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
+10 -24
View File
@@ -3,7 +3,6 @@ package library
import (
"context"
"errors"
"path/filepath"
"strings"
"testing"
@@ -15,19 +14,13 @@ import (
)
// undecidedSlot is one recording filed as Void and as Reach, two songs
// MusicBrainz lists at lengths that cannot tell them apart, from a download
// Minstrel imported: the resolver leaves it pending for an admin.
// MusicBrainz lists at lengths that cannot tell them apart: the resolver
// leaves it pending for an admin.
func undecidedSlot(t *testing.T) (oneAlbumFixture, dbq.User) {
t.Helper()
f := newOneAlbumFixture(t, "acoustic", "Void", "Reach")
ctx := context.Background()
seedTrackList(t, f.pool, f.album, map[string]int{"Void": 220500, "Reach": 221000})
if _, err := f.pool.Exec(ctx,
`INSERT INTO grabs (info_hash, name, key, client, save_path, origin, import_state, destination)
VALUES ('abc123', 'Savant - Void [WEB]', 'k', 'qbit', '/dl', 'schedule', 'imported', $1)`,
filepath.Dir(f.aPath)); err != nil {
t.Fatal(err)
}
if res, err := ResolveDuplicates(ctx, f.pool, nil, "", true); err != nil || res.WrongFiles != 0 {
t.Fatalf("resolve = %+v, %v; want the group left for the operator", res, err)
}
@@ -41,8 +34,8 @@ func undecidedSlot(t *testing.T) (oneAlbumFixture, dbq.User) {
return f, u
}
// emptiedTrack says whether a copy's track is marked missing and waiting for
// the album to be fetched again.
// emptiedTrack says whether a copy's track is marked missing and its slot
// emptied.
func emptiedTrack(t *testing.T, f oneAlbumFixture, id pgtype.UUID) bool {
t.Helper()
var emptied bool
@@ -72,9 +65,8 @@ func settledByHand(t *testing.T, f oneAlbumFixture, actor dbq.User) {
}
}
// "Get it again": the admin cannot say which song the recording is, so
// every copy goes, the download they came from is set aside, and both slots
// wait for the album fetched again. A merge would have kept one title.
// The admin cannot say which song the recording is, so every copy goes and
// both slots show as missing. A merge would have kept one title.
func TestSettleWrongSlot_GetItAgainRemovesEveryCopy_Integration(t *testing.T) {
f, op := undecidedSlot(t)
ctx := context.Background()
@@ -88,12 +80,9 @@ func TestSettleWrongSlot_GetItAgainRemovesEveryCopy_Integration(t *testing.T) {
}
for _, id := range []pgtype.UUID{f.a.ID, f.b.ID} {
if !emptiedTrack(t, f, id) {
t.Errorf("track %s is not waiting to be fetched again", syncpkg.FormatUUID(id))
t.Errorf("track %s is not marked missing with its slot emptied", syncpkg.FormatUUID(id))
}
}
if !releaseBlocked(t, f.pool, "abc123") || len(res.Blocked) != 1 {
t.Errorf("blocked %v; want the download the files came from set aside", res.Blocked)
}
settledByHand(t, f, op)
if _, err := SettleWrongSlot(ctx, f.pool, nil, f.groupID, pgtype.UUID{}, op.ID); !errors.Is(err, ErrDuplicateGroupNotPending) {
@@ -102,7 +91,7 @@ func TestSettleWrongSlot_GetItAgainRemovesEveryCopy_Integration(t *testing.T) {
}
// "This one is Reach": the copy the admin names stays, and only Void's slot
// is emptied and wanted again.
// is emptied.
func TestSettleWrongSlot_KeepsTheCopyTheOperatorNames_Integration(t *testing.T) {
f, op := undecidedSlot(t)
res, err := SettleWrongSlot(context.Background(), f.pool, nil, f.groupID, f.b.ID, op.ID)
@@ -114,10 +103,7 @@ func TestSettleWrongSlot_KeepsTheCopyTheOperatorNames_Integration(t *testing.T)
res, exists(f.aPath), exists(f.bPath))
}
if !emptiedTrack(t, f, f.a.ID) {
t.Error("Void's track is not waiting to be fetched again")
}
if !releaseBlocked(t, f.pool, "abc123") {
t.Error("the download the files came from is not set aside")
t.Error("Void's track is not marked missing with its slot emptied")
}
settledByHand(t, f, op)
}
@@ -141,7 +127,7 @@ func TestSettleWrongSlot_RefusesWhatItCannotSettle_Integration(t *testing.T) {
if _, err := SettleWrongSlot(ctx, f.pool, nil, f.groupID, other, op.ID); !errors.Is(err, ErrSurvivorNotInGroup) {
t.Errorf("err = %v, want ErrSurvivorNotInGroup", err)
}
if !exists(f.aPath) || !exists(f.bPath) || releaseBlocked(t, f.pool, "abc123") {
if !exists(f.aPath) || !exists(f.bPath) {
t.Error("something changed")
}
})