[Audio] Hotfix an edge case where an attribute error can be raised (#3328)

* Limit Playlists

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* Hotfix

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* Hotfix

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
This commit is contained in:
Draper 2020-01-12 21:20:46 +00:00 committed by Michael H
parent b0b76c5a00
commit e52c20b9e7
3 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1 @@
Fixed an attribute error that can be raised on play commands for spotify tracks.

View File

@ -750,6 +750,8 @@ class MusicCache:
log.debug(f"Querying Local Database for {query}") log.debug(f"Querying Local Database for {query}")
task = ("update", ("lavalink", {"query": query})) task = ("update", ("lavalink", {"query": query}))
self.append_task(ctx, *task) self.append_task(ctx, *task)
else:
val = None
if val and not forced: if val and not forced:
data = val data = val
data["query"] = query data["query"] = query

View File

@ -91,6 +91,8 @@ class CacheFetchResult:
k in self.query for k in ["loadType", "playlistInfo", "isSeekable", "isStream"] k in self.query for k in ["loadType", "playlistInfo", "isSeekable", "isStream"]
): ):
self.query = json.loads(self.query) self.query = json.loads(self.query)
else:
self.query = None
@dataclass @dataclass