From: Eric Munson Date: Sun, 9 Mar 2025 23:04:25 +0000 (-0400) Subject: Fix: Subsonic: Catch DataNotFoundError for artwork (#2012) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=90f2a4b5fc8342286020109e4e489fd17e2e48bd;p=music-assistant-server.git Fix: Subsonic: Catch DataNotFoundError for artwork (#2012) This exception simply means that there is no artwork to return (and probably shouldn't be an exception, but there we are). We will catch this exception and return None. Fixes: https://github.com/music-assistant/support/issues/3610 Signed-off-by: Eric B Munson --- diff --git a/music_assistant/providers/opensubsonic/sonic_provider.py b/music_assistant/providers/opensubsonic/sonic_provider.py index ccaae114..30af6369 100644 --- a/music_assistant/providers/opensubsonic/sonic_provider.py +++ b/music_assistant/providers/opensubsonic/sonic_provider.py @@ -384,8 +384,12 @@ class OpenSonicProvider(MusicProvider): """Return the image.""" def _get_cover_art() -> bytes | Any: - with self._conn.getCoverArt(path) as art: - return art.content + try: + with self._conn.getCoverArt(path) as art: + return art.content + except DataNotFoundError: + self.logger.warning("Unable to locate a cover image for %s", path) + return None return await asyncio.to_thread(_get_cover_art)