individual sports api calls

This commit is contained in:
Neythen Treloar
2022-03-07 17:34:24 +00:00
parent e5784af50f
commit 4ba23566bc
2 changed files with 65 additions and 11 deletions

View File

@@ -671,12 +671,16 @@ def save_sports_settings(input_settings):
if feature == 'Sports (Upcoming Games)':
filename = 'upcoming_games.json'
update_key = 'sports_u'
elif feature == 'Sports (Past Games)':
filename = 'past_games.json'
update_key = 'sports_p'
elif feature == 'Sports (Live Games)':
filename = 'live_games.json'
update_key = 'sports_l'
elif feature == 'Sports (Team Stats)':
filename = 'league_tables.json'
update_key = 'sports_t'
current_settings = json.load(open('csv/' + filename, 'r'))
@@ -697,7 +701,7 @@ def save_sports_settings(input_settings):
if any([current_settings['leagues'][k] == [] for k in input_settings['leagues']]):
last_updates['sports']['force'] = True
last_updates[update_key]['force'] = True
f = open('csv/last_updates.json', 'w+')
json.dump(last_updates, f)