premier league bug fixed

This commit is contained in:
Neythen Treloar 2022-02-26 15:50:10 +00:00
parent 9a26c33779
commit d71b2af8fb
2 changed files with 17 additions and 5 deletions

View File

@ -371,7 +371,11 @@ def updateLeagueTables(api_key):
leagues_info = {} leagues_info = {}
for league in leagues: for league in leagues:
if league == 'Premier League':
url += 'PL,'
else:
url += league + ',' url += league + ','
url = url[:-1] # remove last comma url = url[:-1] # remove last comma
url += '&apiKey=' + api_key url += '&apiKey=' + api_key
r = requests.get(url) r = requests.get(url)
@ -437,6 +441,10 @@ def updateLeagueEvents(api_key, time):
leagues_info = {} leagues_info = {}
for league in leagues: for league in leagues:
if league == 'Premier League':
url += 'PL,'
else:
url += league + ',' url += league + ','
url = url[:-1] # remove last comma url = url[:-1] # remove last comma
url += '&apiKey=' + api_key url += '&apiKey=' + api_key
@ -580,6 +588,8 @@ if __name__ == '__main__':
api_keys = f.readlines() api_keys = f.readlines()
api_key = api_keys[0].strip() api_key = api_keys[0].strip()
try: try:
weather_key = api_keys[1].strip() weather_key = api_keys[1].strip()
except Exception as e: except Exception as e:

View File

@ -237,7 +237,7 @@ def update():
os.system("sudo reboot now") os.system("sudo reboot now")
return index() return index()
@app.route("/restart", methods=['PUT','POST']) @app.route("/restart")
def restart(): def restart():
os.system("sudo reboot now") os.system("sudo reboot now")
return index() return index()
@ -468,12 +468,14 @@ def screensaver():
global ticker global ticker
global api_caller global api_caller
global screensaver_p global screensaver_p
api_caller.close()
ticker.close()
data = str(request.data) data = str(request.data)
if displaying_screensaver: if displaying_screensaver:
screensaver_p.close() screensaver_p.close()
else:
api_caller.close()
ticker.close()
if "Pulsating Colors" in data: if "Pulsating Colors" in data: