diff options
author | Parker <contact@pkrm.dev> | 2025-01-22 16:03:57 -0600 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2025-01-22 16:03:57 -0600 |
commit | b48f2a1eff20996901e8db40d68c880a5d7f053f (patch) | |
tree | c0618c25fff81257cc7645b1b761833202787431 /code/cogs | |
parent | 571a12d329ad908f4f407f2dffcf7fbed9497a33 (diff) |
Safety check
Diffstat (limited to 'code/cogs')
-rw-r--r-- | code/cogs/status.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/code/cogs/status.py b/code/cogs/status.py index 769fc8f..ef044cc 100644 --- a/code/cogs/status.py +++ b/code/cogs/status.py @@ -200,13 +200,15 @@ class Status(commands.Cog): session.commit() # If series and only a portion of episodes have been downloaded - if data.get("statistics").get("percentOfEpisodes"): - description += ( - f"\n**{title} ({release_year})** - Status: `NOT" - " FOUND" - f" ({int(data['statistics']['percentOfEpisodes'])}%" - " of eps.)`" - ) + # If data["statistics"] exists and is not None + if "statistics" in data and data["statistics"] != None: + if "percentOfEpisodes" in data["statistics"]: + description += ( + f"\n**{title} ({release_year})** - Status: `NOT" + " FOUND" + f" ({int(data['statistics']['percentOfEpisodes'])}%" + " of eps.)`" + ) # All other scenarios, download not found else: description += ( |