From 8809e6eaf0b03d64789a9c3601b0866e2d52d2dd Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 22 Aug 2023 22:47:02 +0800 Subject: [PATCH] close screensaver if its running --- server.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index f44b555..0f2b760 100755 --- a/server.py +++ b/server.py @@ -1704,7 +1704,9 @@ def saveSchedulerSettings(): @app.route("/saveScreensaverSettings", methods = ['PUT', 'POST']) def saveScreensaverSettings(): - + + global displaying_screensaver + data = request.data.decode('utf-8') input_settings = json.loads(data) @@ -1736,6 +1738,10 @@ def saveScreensaverSettings(): with open('clock_screensaver.json', 'w') as f: json.dump(clock_screensaver,f) + if displaying_screensaver: + screensaver_p.close() + displaying_screensaver = False + return index()