aboutsummaryrefslogtreecommitdiff
path: root/code/utils/custom_sources.py
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-12-16 04:49:24 +0000
committerGitHub <noreply@github.com>2024-12-16 04:49:24 +0000
commita0b6a5b43cb64288a7d190ca55a38367d3bcd0d3 (patch)
treebb01cd5415a9ba8b530482673d7c5b60f7b5eb6a /code/utils/custom_sources.py
parent2399336f6f0e01d69d535d96518d20845424d071 (diff)
parent52c922598398556a89dbb3eb6a3156a094647cf0 (diff)
Merge pull request #11 from PacketParker/dev
Dev
Diffstat (limited to 'code/utils/custom_sources.py')
-rw-r--r--code/utils/custom_sources.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/code/utils/custom_sources.py b/code/utils/custom_sources.py
index 5cf2295..063b886 100644
--- a/code/utils/custom_sources.py
+++ b/code/utils/custom_sources.py
@@ -30,7 +30,7 @@ class CustomAudioTrack(DeferredAudioTrack):
): # Load our 'actual' playback track using the metadata from this one.
dzsearch = f"dzsearch:{self.title} {self.author}"
results = await client.get_tracks(dzsearch)
- if not results.tracks or results.load_type in (
+ if not (results and results.tracks) or results.load_type in (
LoadType.EMPTY,
LoadType.ERROR,
):
@@ -38,14 +38,16 @@ class CustomAudioTrack(DeferredAudioTrack):
ytmsearch = f"ytmsearch:{self.title} {self.author}"
results = await client.get_tracks(ytmsearch)
- if not results.tracks or results.load_type in (
+ if not (results and results.tracks) or results.load_type in (
LoadType.EMPTY,
LoadType.ERROR,
):
ytsearch = f"ytsearch:{self.title} {self.author} audio"
results = await client.get_tracks(ytsearch)
- if not results.tracks or results.load_type in (
+ if not (
+ results and results.tracks
+ ) or results.load_type in (
LoadType.EMPTY,
LoadType.ERROR,
):