aboutsummaryrefslogtreecommitdiff
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
parent2399336f6f0e01d69d535d96518d20845424d071 (diff)
parent52c922598398556a89dbb3eb6a3156a094647cf0 (diff)
Merge pull request #11 from PacketParker/dev
Dev
-rw-r--r--application.yml4
-rw-r--r--code/cogs/play.py8
-rw-r--r--code/utils/ai_recommendations.py4
-rw-r--r--code/utils/custom_sources.py8
4 files changed, 14 insertions, 10 deletions
diff --git a/application.yml b/application.yml
index 68381f1..0314360 100644
--- a/application.yml
+++ b/application.yml
@@ -32,11 +32,11 @@ plugins:
flowerytts: falsee
youtube: false
deezer:
- masterDecryptionKey: "" # the master key used for decrypting the deezer tracks. (yes this is not here you need to get it from somewhere else)
+ masterDecryptionKey: "" # master decryption key from deezer
lavalink:
plugins:
- - dependency: "dev.lavalink.youtube:youtube-plugin:1.8.3"
+ - dependency: "dev.lavalink.youtube:youtube-plugin:1.11.1"
snapshot: false
- dependency: "com.github.topi314.lavasrc:lavasrc-plugin:4.3.0"
snapshot: false
diff --git a/code/cogs/play.py b/code/cogs/play.py
index 1756141..2e07486 100644
--- a/code/cogs/play.py
+++ b/code/cogs/play.py
@@ -63,7 +63,7 @@ class Play(commands.Cog):
dzsearch = f"dzsearch:{query}"
results = await player.node.get_tracks(dzsearch)
# If Deezer returned nothing
- if not results.tracks or results.load_type in (
+ if not (results and results.tracks) or results.load_type in (
LoadType.EMPTY,
LoadType.ERROR,
):
@@ -71,7 +71,9 @@ class Play(commands.Cog):
ytmsearch = f"ytmsearch:{query}"
results = await player.node.get_tracks(ytmsearch)
# If YouTube Music returned nothing
- if not results.tracks or results.load_type in (
+ if not (
+ results and results.tracks
+ ) or results.load_type in (
LoadType.EMPTY,
LoadType.ERROR,
):
@@ -82,7 +84,7 @@ 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.tracks or results.load_type in (
+ if not (results and results.tracks) or results.load_type in (
LoadType.EMPTY,
LoadType.ERROR,
):
diff --git a/code/utils/ai_recommendations.py b/code/utils/ai_recommendations.py
index 68764bc..2fc71d3 100644
--- a/code/utils/ai_recommendations.py
+++ b/code/utils/ai_recommendations.py
@@ -62,14 +62,14 @@ async def add_song_recommendations(
ytsearch = f"ytsearch:{song} by {artist} audio"
results = await player.node.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,
):
dzsearch = f"dzsearch:{song}"
results = await player.node.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,
):
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,
):