From aeae1a56d3699b58c503d4956b343348914093d0 Mon Sep 17 00:00:00 2001 From: Justin Date: Sat, 23 Sep 2023 18:01:42 +0800 Subject: [PATCH] added force update for quotes if num of jokes is changed --- server.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server.py b/server.py index 23bedd8..b2f101e 100755 --- a/server.py +++ b/server.py @@ -1777,6 +1777,15 @@ def save_quotes_settings(input_settings): except: current_settings = {"feature": "Inspirational Quotes", "speed": "medium", "speed2": "medium", "animation": "up", "title": True, "amount": "3", "quotes": []} + if current_settings['amount'] != input_settings['amount']: + f = open('csv/last_updates.json', 'r') + last_updates = json.load(f) + f.close() + last_updates['quotes']['force'] = True + f = open('csv/last_updates.json', 'w') + json.dump(last_updates, f) + f.close() + current_settings['speed'] = input_settings['speed'].lower() current_settings['speed2'] = input_settings['speed2'].lower() current_settings['animation'] = input_settings['animation'].lower()