From ce6ce4d8d6a01c136beb77e768fa5f5eacbfc9ec Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Thu, 11 Jun 2026 09:39:40 -0700 Subject: [PATCH] Search: auto-select Spotify when "Spotify (no auth)" is the active source MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On the Search page and the global search widget (both share createSearchController), the source picker stayed empty when the active metadata source was Spotify-no-auth, until you clicked Spotify manually. Root cause: get_primary_source_status reports the no-auth composite as source 'spotify_free' (for display labelling). The controller's initActiveSource set activeSource = 'spotify_free' (it's a valid SOURCE_LABELS entry), but the icon row renders from SOURCE_ORDER, which only has 'spotify' — so no icon matched the active source and nothing highlighted. Fix: normalize 'spotify_free' -> 'spotify' when deriving the initial active source (they're the same searchable source; the picker only has a Spotify icon). Now no-auth auto-selects Spotify like plain Spotify does. One spot, fixes both surfaces. --- webui/static/shared-helpers.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webui/static/shared-helpers.js b/webui/static/shared-helpers.js index f5a0b958..620fec26 100644 --- a/webui/static/shared-helpers.js +++ b/webui/static/shared-helpers.js @@ -281,7 +281,12 @@ function createSearchController({ if (resp.ok) { const status = await resp.json(); const ms = status && status.metadata_source; - const src = (ms && typeof ms === 'object') ? ms.source : ms; + let src = (ms && typeof ms === 'object') ? ms.source : ms; + // "Spotify (no auth)" reports as 'spotify_free' for display, but the + // search picker only has a 'spotify' icon (it's the same searchable + // source). Map it so no-auth auto-selects Spotify instead of leaving + // the picker empty (no SOURCE_ORDER icon matches 'spotify_free'). + if (src === 'spotify_free') src = 'spotify'; if (src && SOURCE_LABELS[src]) state.activeSource = src; } } catch (_) { /* best-effort */ }