Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions homeassistant/components/media_player/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,9 @@ async def _async_fetch_image(self, url):
except asyncio.TimeoutError:
pass

if content is None:
_LOGGER.warning("Error retrieving proxied image from %s", url)

return content, content_type

def get_browse_image_url(
Expand All @@ -910,15 +913,12 @@ def get_browse_image_url(
f"/api/media_player_proxy/{self.entity_id}/browse_media"
f"/{media_content_type}/{media_content_id}"
)
url = str(
URL(url_path).with_query(
{
"token": self.access_token,
"media_image_id": media_image_id,
}
)
)
return url

url_query = {"token": self.access_token}
if media_image_id:
url_query["media_image_id"] = media_image_id

return str(URL(url_path).with_query(url_query))


class MediaPlayerImageView(HomeAssistantView):
Expand Down