Allow scrobbling video games

This commit is contained in:
2023-03-05 18:05:10 -05:00
parent df62865eea
commit a4537879f9
7 changed files with 72 additions and 9 deletions

View File

@ -14,7 +14,11 @@ client = TheSportsDbClient(api_key=API_KEY)
def lookup_event_from_thesportsdb(event_id: str) -> dict:
event = client.lookup_event(event_id)["events"][0]
try:
event = client.lookup_event(event_id)["events"][0]
except TypeError:
return {}
if not event or type(event) != dict:
return {}
league = {} # client.lookup_league(league_id=event.get('idLeague'))