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
+5 -32
View File
@@ -8,7 +8,7 @@
// in the library at the time, so a recording that reaches the library later
// (an import, or an MBID the AcoustID lookup fills in) gains its edges without
// asking LB again. For artists it stores the in-library matches in
// artist_similarity and the rest in artist_similarity_unmatched.
// artist_similarity.
//
// Every answer is recorded as a fetch, an empty one included, and the queue
// reads those records rather than the edges: a seed that matched nothing is
@@ -39,7 +39,7 @@ type Worker struct {
logger *slog.Logger
tick time.Duration
batch int32
topK int // per artist, for each of the matched and unmatched stores
topK int // per artist
}
// NewWorker constructs a worker with production defaults: 1h tick,
@@ -200,8 +200,8 @@ func (w *Worker) upsertArtistSimilar(ctx context.Context, q *dbq.Queries, artist
}
sort.Slice(results, func(i, j int) bool { return results[i].Score > results[j].Score })
// Scores are stored relative to the seed's closest artist, as track edges
// are: LB's raw scores are unbounded counts, and both the candidate pool
// and the suggestions read 0 to 1.
// are: LB's raw scores are unbounded counts, and the candidate pool reads
// 0 to 1.
best := results[0].Score
mbids := make([]string, 0, len(results))
@@ -220,7 +220,7 @@ func (w *Worker) upsertArtistSimilar(ctx context.Context, q *dbq.Queries, artist
}
}
// Matched: in-library similars → artist_similarity (existing path).
// In-library similars → artist_similarity.
takenMatched := 0
for _, r := range results {
if takenMatched >= w.topK {
@@ -242,33 +242,6 @@ func (w *Worker) upsertArtistSimilar(ctx context.Context, q *dbq.Queries, artist
takenMatched++
}
// Unmatched: out-of-library similars → artist_similarity_unmatched (M5c).
// Same top-K cap as the matched path. Skip rows missing a name — we can't
// render a suggestion card without one.
takenUnmatched := 0
for _, r := range results {
if takenUnmatched >= w.topK {
break
}
if _, inLib := idByMBID[r.MBID]; inLib {
continue
}
if r.Name == "" {
w.logger.Debug("similarity: skipping unmatched similar with empty name", "mbid", r.MBID)
continue
}
if uerr := q.UpsertArtistSimilarityUnmatched(ctx, dbq.UpsertArtistSimilarityUnmatchedParams{
SeedArtistID: artistAID,
CandidateMbid: r.MBID,
CandidateName: r.Name,
Score: relativeScore(r.Score, best),
Source: "listenbrainz",
}); uerr != nil {
w.logger.Warn("similarity: UpsertArtistSimilarityUnmatched", "err", uerr)
continue
}
takenUnmatched++
}
}
// relativeScore is score over the seed's best, in [0, 1]; 0 when the seed has