diff --git a/changelog.d/audio/3328.hotfix.1.rst b/changelog.d/audio/3328.hotfix.1.rst new file mode 100644 index 000000000..08e7ed7b9 --- /dev/null +++ b/changelog.d/audio/3328.hotfix.1.rst @@ -0,0 +1 @@ +Fixed an attribute error that can be raised on play commands for spotify tracks. \ No newline at end of file diff --git a/redbot/cogs/audio/apis.py b/redbot/cogs/audio/apis.py index eb6dbd7c0..87745d5ce 100644 --- a/redbot/cogs/audio/apis.py +++ b/redbot/cogs/audio/apis.py @@ -750,6 +750,8 @@ class MusicCache: log.debug(f"Querying Local Database for {query}") task = ("update", ("lavalink", {"query": query})) self.append_task(ctx, *task) + else: + val = None if val and not forced: data = val data["query"] = query diff --git a/redbot/cogs/audio/databases.py b/redbot/cogs/audio/databases.py index 6951a91b7..ee136c222 100644 --- a/redbot/cogs/audio/databases.py +++ b/redbot/cogs/audio/databases.py @@ -91,6 +91,8 @@ class CacheFetchResult: k in self.query for k in ["loadType", "playlistInfo", "isSeekable", "isStream"] ): self.query = json.loads(self.query) + else: + self.query = None @dataclass