aboutsummaryrefslogtreecommitdiff
path: root/code/cogs/play.py
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-12-18 17:42:23 -0600
committerParker <contact@pkrm.dev>2024-12-18 17:42:23 -0600
commit235254257e1660cb130e427a107e986ecec003bf (patch)
tree96d7d2b8ec02aa8d5814351a05bec834f15d3553 /code/cogs/play.py
parenta0b6a5b43cb64288a7d190ca55a38367d3bcd0d3 (diff)
Expand conditional checks for results, tracks, and load_type
Diffstat (limited to 'code/cogs/play.py')
-rw-r--r--code/cogs/play.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/code/cogs/play.py b/code/cogs/play.py
index 2e07486..76704ac 100644
--- a/code/cogs/play.py
+++ b/code/cogs/play.py
@@ -63,9 +63,15 @@ class Play(commands.Cog):
dzsearch = f"dzsearch:{query}"
results = await player.node.get_tracks(dzsearch)
# If Deezer returned nothing
- if not (results and results.tracks) or results.load_type in (
- LoadType.EMPTY,
- LoadType.ERROR,
+ if (
+ not results
+ or not results.tracks
+ or not results.load_type
+ or results.load_type
+ in (
+ LoadType.EMPTY,
+ LoadType.ERROR,
+ )
):
if YOUTUBE_SUPPORT:
ytmsearch = f"ytmsearch:{query}"
@@ -84,9 +90,15 @@ class Play(commands.Cog):
results = await player.node.get_tracks(query)
# If there are no results found, set results/embed to None, handled further down
- if not (results and results.tracks) or results.load_type in (
- LoadType.EMPTY,
- LoadType.ERROR,
+ if (
+ not results
+ or not results.tracks
+ or not results.load_type
+ or results.load_type
+ in (
+ LoadType.EMPTY,
+ LoadType.ERROR,
+ )
):
results, embed = None, None