fixed display bug when switching between professional and standard without saving in between

This commit is contained in:
Neythen Treloar 2022-02-24 17:23:18 +00:00
parent e572fb5142
commit 9c81db3665
2 changed files with 4 additions and 3 deletions

View File

@ -143,10 +143,11 @@ def index():
def save_displaying(input_settings): def save_displaying(input_settings):
#print('save') #print('save')
global professional
print('save_displaying_input:', input_settings) print('save_displaying_input:', input_settings)
all_settings = ['Stocks', 'Crypto', 'Forex', 'Current Weather', 'Daily Forecast', 'News', 'Sports (Upcoming Games)', 'Sports (Past Games)', 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'] 'Sports (Live Games)', 'Sports (Team Stats)', 'Custom Images', 'Custom GIFs', 'Custom Messages']
professional = len(input_settings) == 2
if professional: if professional:
all_settings = ['Stocks', 'Crypto', 'Forex', 'Current Weather', 'News'] all_settings = ['Stocks', 'Crypto', 'Forex', 'Current Weather', 'News']
@ -155,7 +156,7 @@ def save_displaying(input_settings):
display_settings = [] display_settings = []
if professional: if professional:
input_settings = [[]]*2
input_settings[0] = [i for i in input_settings[0] if i in all_settings] 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] input_settings[1] = [i for i in input_settings[1] if i in all_settings]

View File

@ -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" 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 '{"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 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 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