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 <eric@munsonfam.org>
"""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)