mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-27 00:02:21 +01:00
Align the shared stream watchdog with the UI review
This commit is contained in:
+4
-1
@@ -6149,9 +6149,12 @@ import { invalidateSettings } from './appConfig.js';
|
||||
cache: 'no-store',
|
||||
});
|
||||
if (!_getForegroundStreamState() || _backgroundStreams.has(sid)) return;
|
||||
// The server now reports "no active stream" as 200 {status:"idle"} (an
|
||||
// older server used 404); a body with status "streaming" means it is NOT
|
||||
// stale. Accept both so the watchdog keeps working across deploys.
|
||||
if (res.status !== 404 && !res.ok) return;
|
||||
let _probe = null;
|
||||
try { _probe = await res.json(); } catch (_) { /* An invalid response is not an idle stream. */ }
|
||||
try { _probe = await res.json(); } catch (_) { _probe = null; }
|
||||
const _noActiveStream = res.status === 404 || (res.ok && _probe &&
|
||||
typeof _probe.status === 'string' && _probe.status !== 'streaming');
|
||||
if (!_noActiveStream) return;
|
||||
|
||||
Reference in New Issue
Block a user