From 36fadf7e58337493c62fd512278774e279507f06 Mon Sep 17 00:00:00 2001 From: Marks Polakovs Date: Tue, 16 Jun 2020 12:05:47 +0200 Subject: [PATCH] Avoid killing a non-WebStudio show if the connection drops (#135) --- stateserver.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/stateserver.py b/stateserver.py index 3fb4830..6f8bd08 100755 --- a/stateserver.py +++ b/stateserver.py @@ -389,11 +389,13 @@ def post_wsSessions() -> Any: if currentShow and currentShow["connid"] == conn["connid"]: # they should be on air now, but they've just died. go to jukebox. # but don't kill it during the news, or after the end time, to avoid unexpected jukeboxing - now = datetime.datetime.now().timestamp() - if now < (currentShow["endTimestamp"] - 15): - print("jukeboxing due to their disappearance...") - subprocess.Popen(['sel', str(SOURCE_JUKEBOX)]) - do_ws_srv_telnet("NUL") + # Also, avoid killing them if they're on a non-WS source + if currentShow["sourceid"] == SOURCE_WS: + now = datetime.datetime.now().timestamp() + if now < (currentShow["endTimestamp"] - 15): + print("jukeboxing due to their disappearance...") + subprocess.Popen(['sel', str(SOURCE_JUKEBOX)]) + do_ws_srv_telnet("NUL") return genPayload("Thx, K, bye.")