hass-music-assistant: Error when attempting to retrieve artwork from file

What version of Music Assistant has the issue?

2023.2.1

The problem

I don’t think that missing artwork should constitute an error, it’s a warning at best, if even that.

I get that this isn’t MA that is actually throwing the exception here, but perhaps it could let the client know that it doesn’t have artwork so that the client wouldn’t bother trying to retrieve it, or at least retrieve some default artwork instead.

How to reproduce

Have music without album artwork. Click on the album in M.A. and you should see the error.

Relevant log output

homeassistant    | 2023-02-28 10:11:10.408 ERROR (MainThread) [aiohttp.server] Error handling request
homeassistant    | Traceback (most recent call last):
homeassistant    |   File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
homeassistant    |     resp = await request_handler(request)
homeassistant    |   File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
homeassistant    |     resp = await handler(request)
homeassistant    |   File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
homeassistant    |     return await handler(request)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
homeassistant    |     return await handler(request)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
homeassistant    |     return await handler(request)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
homeassistant    |     return await handler(request)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
homeassistant    |     return await handler(request)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
homeassistant    |     return await handler(request)
homeassistant    |   File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 145, in handle
homeassistant    |     result = await result
homeassistant    |   File "/config/custom_components/mass/panel.py", line 92, in get
homeassistant    |     data = await mass.metadata.get_thumbnail(url, size=size)
homeassistant    |   File "/usr/local/lib/python3.10/site-packages/music_assistant/controllers/metadata/metadata.py", line 260, in get_thumbnail
homeassistant    |     thumbnail = await create_thumbnail(self.mass, path, size)
homeassistant    |   File "/usr/local/lib/python3.10/site-packages/music_assistant/helpers/images.py", line 45, in create_thumbnail
homeassistant    |     img_data = await get_image_data(mass, path)
homeassistant    |   File "/usr/local/lib/python3.10/site-packages/music_assistant/helpers/images.py", line 38, in get_image_data
homeassistant    |     raise FileNotFoundError(f"Image not found: {path}")

Additional information

No response

What version of Home Assistant Core are your running

2023.2.5

What type of installation are you running?

Home Assistant Container

On what type of hardware are you running?

Linux

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 22 (14 by maintainers)

Most upvoted comments

No, I haven’t attempted to upgrade yet…I was waiting for HACS to notify me of a new version, and I’m just now reading that I can run MA in a separate docker container, which I will do later tonight.