added force update for quotes if num of jokes is changed

This commit is contained in:
Justin 2023-09-23 18:01:42 +08:00 committed by GitHub
parent f331c70454
commit aeae1a56d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()