diff --git a/web/src/lib/player/store.svelte.ts b/web/src/lib/player/store.svelte.ts index 2a7577d3..42650296 100644 --- a/web/src/lib/player/store.svelte.ts +++ b/web/src/lib/player/store.svelte.ts @@ -462,7 +462,18 @@ $effect.root(() => { _radioRefreshInFlight = true; const seed = _radioSeedId; - const exclude = _queue.map((t) => t.id).join(','); + // Drift #554: cap the exclude list so a multi-hour radio session + // doesn't grow the query string past common 8KB limits and start + // 414-ing /api/radio. The .catch() below would silently swallow + // that failure and the player would stop topping up — a dead + // radio. The server's RecentlyPlayedHours filter already handles + // broader history dedup, so the request-side exclude only needs + // to cover the visible queue's recent tail. + const RADIO_EXCLUDE_CAP = 100; + const exclude = _queue + .slice(-RADIO_EXCLUDE_CAP) + .map((t) => t.id) + .join(','); api .get( `/api/radio?seed_track=${encodeURIComponent(seed)}&exclude=${exclude}` diff --git a/web/src/routes/library/+page.server.ts b/web/src/routes/library/+page.ts similarity index 60% rename from web/src/routes/library/+page.server.ts rename to web/src/routes/library/+page.ts index 11a5e992..a5547a20 100644 --- a/web/src/routes/library/+page.server.ts +++ b/web/src/routes/library/+page.ts @@ -4,6 +4,11 @@ import { redirect } from '@sveltejs/kit'; // always renders the active sub-page. Bare hits go to the default tab // (Artists, matching Android's LibraryScreen default). 308 = permanent // + preserve method, so SPA navigations and direct loads behave the same. +// +// Drift #559: this was a +page.server.ts which DOES NOT run in +// production — the app is configured as adapter-static + ssr=false +// (see +layout.ts). +page.ts (universal load) runs client-side, which +// is what the SPA actually executes when a route is hit. export const load = () => { throw redirect(308, '/library/artists'); }; diff --git a/web/src/routes/playlists/+page.server.ts b/web/src/routes/playlists/+page.ts similarity index 69% rename from web/src/routes/playlists/+page.server.ts rename to web/src/routes/playlists/+page.ts index a425747b..d506d638 100644 --- a/web/src/routes/playlists/+page.server.ts +++ b/web/src/routes/playlists/+page.ts @@ -5,6 +5,10 @@ import { redirect } from '@sveltejs/kit'; // still lives here at /routes/playlists/[id]/+page.svelte — that URL // matches the server API shape and is unchanged. // 308 = permanent + preserve method; old bookmarks land on the new URL. +// +// Drift #559: this was a +page.server.ts which DOES NOT run in +// production (adapter-static + ssr=false, see +layout.ts). +page.ts +// universal load runs client-side and IS what the SPA executes. export const load = () => { throw redirect(308, '/library/playlists'); };