diff --git a/redbot/cogs/audio/apis/playlist_wrapper.py b/redbot/cogs/audio/apis/playlist_wrapper.py index f38b32cc1..0a884ef18 100644 --- a/redbot/cogs/audio/apis/playlist_wrapper.py +++ b/redbot/cogs/audio/apis/playlist_wrapper.py @@ -84,7 +84,9 @@ class PlaylistWrapper: table = 2 return table - async def fetch(self, scope: str, playlist_id: int, scope_id: int) -> PlaylistFetchResult: + async def fetch( + self, scope: str, playlist_id: int, scope_id: int + ) -> Optional[PlaylistFetchResult]: """Fetch a single playlist.""" scope_type = self.get_scope_type(scope) @@ -107,7 +109,8 @@ class PlaylistWrapper: try: row_result = future.result() except Exception as exc: - debug_exc_log(log, exc, "Failed to completed playlist fetch from database") + debug_exc_log(log, exc, "Failed to complete playlist fetch from database") + return None row = row_result.fetchone() if row: row = PlaylistFetchResult(*row) @@ -139,7 +142,7 @@ class PlaylistWrapper: try: row_result = future.result() except Exception as exc: - debug_exc_log(log, exc, "Failed to completed playlist fetch from database") + debug_exc_log(log, exc, "Failed to complete playlist fetch from database") return [] else: for future in concurrent.futures.as_completed( @@ -154,7 +157,7 @@ class PlaylistWrapper: try: row_result = future.result() except Exception as exc: - debug_exc_log(log, exc, "Failed to completed playlist fetch from database") + debug_exc_log(log, exc, "Failed to complete playlist fetch from database") return [] async for row in AsyncIter(row_result): output.append(PlaylistFetchResult(*row)) @@ -191,7 +194,8 @@ class PlaylistWrapper: try: row_result = future.result() except Exception as exc: - debug_exc_log(log, exc, "Failed to completed fetch from database") + debug_exc_log(log, exc, "Failed to complete fetch from database") + return [] async for row in AsyncIter(row_result): output.append(PlaylistFetchResult(*row))