Web: der Sleep-Timer zählt und stoppt auch beim Radio
All checks were successful
Build and push Docker image / build (push) Successful in 14s
Test / test (push) Successful in 5m17s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mrwnslz 2026-10-02 13:16:24 +02:00
parent 7c87343e66
commit 1533497409

View file

@ -453,6 +453,7 @@
this.leftMs = 0; this.leftMs = 0;
setFade(1); setFade(1);
pause(); pause();
stopRadio(); // the radio sleeps too (it plays in app.js's element)
return; return;
} }
if (this.leftMs < FADE_MS) setFade(Math.max(this.leftMs / FADE_MS, 0.1)); if (this.leftMs < FADE_MS) setFade(Math.max(this.leftMs / FADE_MS, 0.1));
@ -758,7 +759,8 @@
if (playing && Date.now() - lastSaved > 10000) saveNow(id, true); if (playing && Date.now() - lastSaved > 10000) saveNow(id, true);
if (playing) skipOutro(id); if (playing) skipOutro(id);
} }
sleep.tick(playing); // The sleep timer counts while either plays (radio and podcasts share the player).
sleep.tick(playing || radioPlaying());
if (playing || sleep.leftMs > 0) report(); if (playing || sleep.leftMs > 0) report();
}, 1000); }, 1000);