From 271243a3344684d0d313599e40c17f8c06a39258 Mon Sep 17 00:00:00 2001 From: teahubxyz Date: Tue, 20 Oct 2026 21:29:28 +0000 Subject: [PATCH] gandora: refreshing a station link resumes the station rather than refilling the seed box Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01K6897PWcUEwHiqZMcVnNF6 --- ventures/gandora/index.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ventures/gandora/index.html b/ventures/gandora/index.html index c7410cd..ca99d62 100644 --- a/ventures/gandora/index.html +++ b/ventures/gandora/index.html @@ -1122,7 +1122,15 @@ const sharedT = new URLSearchParams(location.search).get("t"); if (sharedT) { try { const t = JSON.parse(unb64u(sharedT)); if (t && t.seed && t.title) { openStation(t.seed, { name: t.station || "", first: { title: t.title, tags: t.tags, lyrics: t.lyrics || "", bpm: t.bpm, key: t.key, energy: t.energy, line: t.line || "", station: t.station || "" } }); } } catch { toast("That link didn't carry a track."); } -} else if (location.hash.length > 1) { $("#seedIn").value = decodeURIComponent(location.hash.slice(1)).replace(/\+/g, " "); $("#seedIn").dispatchEvent(new Event("input")); } +} else if (location.hash.length > 1 && !sharedTape) { + // a station link: resume that station if this browser has it (its latest track plays, free); otherwise fill the seed + const seed = decodeURIComponent(location.hash.slice(1)).replace(/\+/g, " "); + db.all("stations").then((list) => { + const s = list.find((x) => x.seed === seed); + if (s) resumeStation(s); + else { $("#seedIn").value = seed; $("#seedIn").dispatchEvent(new Event("input")); } + }).catch(() => { $("#seedIn").value = seed; $("#seedIn").dispatchEvent(new Event("input")); }); +}