f1 and nascar

This commit is contained in:
Justin 2023-03-23 18:27:58 +08:00 committed by GitHub
parent 8a700d37bc
commit 6e4eb0434a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -847,6 +847,8 @@ def updateLeagueEvents(api_key, time, logf):
events = []
if (league == 'PGA') or (league == 'LPGA') or (league == 'PGA_EU') or (league == 'LIV'):
ten_or_fifteen = slice(3)
elif (league == 'F1') or (league == 'NASCAR'):
ten_or_fifteen = slice(5)
else:
ten_or_fifteen = slice(None)
for d in all_data[league][ten_or_fifteen]:
@ -857,7 +859,7 @@ def updateLeagueEvents(api_key, time, logf):
event['progess'] = d['strProgress']
event['status'] = d['strStatus']
else:
if (league == 'PGA') or (league == 'LPGA') or (league == 'PGA_EU') or (league == 'LIV'):
if (league == 'PGA') or (league == 'LPGA') or (league == 'PGA_EU') or (league == 'LIV') or (league == 'F1') or (league == 'NASCAR'):
event['date'] = d['dateEvent']
event['event'] = d['strEvent'].replace("\u2019","'")
event['venue'] = d['strVenue'].replace("\u2019","'")