added lite version

This commit is contained in:
Marco Mooren
2026-05-27 15:04:14 +02:00
parent 3def9e0aac
commit 2e833b0bae
7 changed files with 47 additions and 13 deletions

View File

@@ -338,6 +338,17 @@ function handleCommand(msg) {
if (id === state.np.stationId && (state.np.playing || state.np.loading)) return;
if (id === _pendingStationId) return;
_pendingStationId = id;
// Stop old audio immediately — mirror the UI path where the station
// object is already available and player.stop() fires synchronously
// inside player.play(). Without this, the old stream keeps playing
// for the full round-trip of the metadata fetch below.
endCurrentSession();
try { player.stop(); } catch { /* ignore */ }
state.np.playing = false;
state.np.loading = true;
state.np.station = null;
state.np.stationId = id;
render();
const gen = ++_cmdGen;
api.get(`/api/stations/${id}`).then((st) => {
// Bail if a newer command superseded this one while the