From c9905937cc593c3ab88b5d600e0b60b096433400 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 14 Jul 2026 20:37:28 +0200 Subject: [PATCH] feat(discover): suggest full albums only (filter singles/EPs) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Discovery's "Suggested albums" surfaced singles and EPs because _derive_albums filtered with is_core_release (Album/Single/EP). Add a discovery-only _album_kind_ok gate that, when discover.albumsOnly (new config, default true), requires primary_type == "Album" with no secondary types. is_core_release is untouched — the monitor/scan still use it. Exposed discover.albumsOnly in the discover config route + a Discovery settings toggle. Worker + web tests added. Co-Authored-By: Claude Opus 4.8 (1M context) --- web/src/app/api/discover/config/route.ts | 1 + web/src/app/settings/settings-form.tsx | 9 ++++++++ worker/lyra_worker/discovery.py | 22 ++++++++++++++++++- worker/tests/test_discovery_albums.py | 27 ++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 1 deletion(-) diff --git a/web/src/app/api/discover/config/route.ts b/web/src/app/api/discover/config/route.ts index 3726378..81d3403 100644 --- a/web/src/app/api/discover/config/route.ts +++ b/web/src/app/api/discover/config/route.ts @@ -5,6 +5,7 @@ const DEFAULTS: Record = { "discover.intervalHours": "168", "discover.similarPerSeed": "20", "discover.albumsPerArtist": "1", + "discover.albumsOnly": "true", "discover.minScore": "0", "discover.chunkSize": "5", "discover.listenBrainzUrl": "", diff --git a/web/src/app/settings/settings-form.tsx b/web/src/app/settings/settings-form.tsx index c86b1da..1922e19 100644 --- a/web/src/app/settings/settings-form.tsx +++ b/web/src/app/settings/settings-form.tsx @@ -394,6 +394,7 @@ export function SettingsForm() { artists are processed per worker cycle (keeps job-claiming responsive on big rosters). Similar per seed — candidates pulled per artist. Albums per artist — releases surfaced per suggested artist. Min score — drops weak suggestions.{" "} + Albums only — suggest full-length albums only, hiding singles and EPs.{" "} ListenBrainz base URL — leave blank for the default endpoint. @@ -405,6 +406,14 @@ export function SettingsForm() { ))} +