aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2025-01-22 16:03:57 -0600
committerParker <contact@pkrm.dev>2025-01-22 16:03:57 -0600
commitb48f2a1eff20996901e8db40d68c880a5d7f053f (patch)
treec0618c25fff81257cc7645b1b761833202787431 /code
parent571a12d329ad908f4f407f2dffcf7fbed9497a33 (diff)
Safety check
Diffstat (limited to 'code')
-rw-r--r--code/cogs/status.py16
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 += (