From 9c81db3665e0019ed89c73d0d2ea938f624f7462 Mon Sep 17 00:00:00 2001 From: Neythen Treloar Date: Thu, 24 Feb 2022 17:23:18 +0000 Subject: [PATCH] fixed display bug when switching between professional and standard without saving in between --- server.py | 5 +++-- setup_config_files.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index d991484..b9bb354 100755 --- a/server.py +++ b/server.py @@ -143,10 +143,11 @@ def index(): def save_displaying(input_settings): #print('save') + global professional print('save_displaying_input:', input_settings) all_settings = ['Stocks', 'Crypto', 'Forex', 'Current Weather', 'Daily Forecast', 'News', 'Sports (Upcoming Games)', 'Sports (Past Games)', 'Sports (Live Games)', 'Sports (Team Stats)', 'Custom Images', 'Custom GIFs', 'Custom Messages'] - + professional = len(input_settings) == 2 if professional: all_settings = ['Stocks', 'Crypto', 'Forex', 'Current Weather', 'News'] @@ -155,7 +156,7 @@ def save_displaying(input_settings): display_settings = [] if professional: - input_settings = [[]]*2 + input_settings[0] = [i for i in input_settings[0] if i in all_settings] input_settings[1] = [i for i in input_settings[1] if i in all_settings] diff --git a/setup_config_files.sh b/setup_config_files.sh index 0239bf6..4080692 100755 --- a/setup_config_files.sh +++ b/setup_config_files.sh @@ -19,7 +19,7 @@ touch GIF_settings.json news_settings.json image_settings.json past_games.json g filenames="coin_list.json last_update.csv scroll_text.csv crypto_settings.json last_updates.json settings.csv league_tables.json current_weather.json stocks_settings.json daily_weather.json live_games.json display_settings.json message_settings.json upcoming_games.json forex_settings.json multiple.csv GIF_settings.json news_settings.json image_settings.json past_games.json" echo '{"update_available": false, "first_boot": true}' >> system_info.json -echo [\"Standard\", [\"Stocks\", \"Crypto\", \"Forex\"]] >> display_settings.json +echo [\"Standard\", [[\"Stocks\", \"Crypto\", \"Forex\"]]] >> display_settings.json echo hello world!,255,255,0 >> scroll_text.csv echo '{"feature": "Stocks", "speed": "medium", "animation": "down", "percent": false, "point": false, "logos": true, "chart": false, "title": true, "symbols": {"ETH,USD": {"current": "2629.32", "24hr_change": "-27.6432", "percent_change": "-1.04"}, "BTC,USD": {"current": "38161.00", "24hr_change": "-50.8386", "percent_change": "-0.13"}, "BNB,USD": {"current": "372.57", "24hr_change": "0.4140", "percent_change": "0.11"}, "ADA,BTC": {"current": "0.0000", "24hr_change": "-0.0000", "percent_change": "-3.74"}}}' >> crypto_settings.json