diff options
Diffstat (limited to 'code/utils/custom_sources.py')
-rw-r--r-- | code/utils/custom_sources.py | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/code/utils/custom_sources.py b/code/utils/custom_sources.py index 063b886..8895b7c 100644 --- a/code/utils/custom_sources.py +++ b/code/utils/custom_sources.py @@ -30,17 +30,29 @@ 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 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:{self.title} {self.author}" results = await client.get_tracks(ytmsearch) - 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, + ) ): ytsearch = f"ytsearch:{self.title} {self.author} audio" results = await client.get_tracks(ytsearch) |