From 90f2a4b5fc8342286020109e4e489fd17e2e48bd Mon Sep 17 00:00:00 2001 From: Eric Munson Date: Sun, 9 Mar 2025 19:04:25 -0400 Subject: [PATCH] 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 --- music_assistant/providers/opensubsonic/sonic_provider.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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) -- 2.34.1