mirror of
https://github.com/home-assistant/core.git
synced 2025-12-20 02:48:57 +00:00
Fix Philips TV channel logos not displaying in media browser (#158975)
This commit is contained in:
@@ -250,6 +250,10 @@ class PhilipsTVMediaPlayer(PhilipsJsEntity, MediaPlayerEntity):
|
|||||||
media_content_type=MediaType.CHANNEL,
|
media_content_type=MediaType.CHANNEL,
|
||||||
can_play=True,
|
can_play=True,
|
||||||
can_expand=False,
|
can_expand=False,
|
||||||
|
thumbnail=self.get_browse_image_url(
|
||||||
|
MediaType.CHANNEL,
|
||||||
|
f"{self._tv.channel_list_id}/{channel['ccid']}",
|
||||||
|
),
|
||||||
)
|
)
|
||||||
for channel in self._tv.channels_current
|
for channel in self._tv.channels_current
|
||||||
]
|
]
|
||||||
@@ -289,6 +293,10 @@ class PhilipsTVMediaPlayer(PhilipsJsEntity, MediaPlayerEntity):
|
|||||||
media_content_type=MediaType.CHANNEL,
|
media_content_type=MediaType.CHANNEL,
|
||||||
can_play=True,
|
can_play=True,
|
||||||
can_expand=False,
|
can_expand=False,
|
||||||
|
thumbnail=self.get_browse_image_url(
|
||||||
|
MediaType.CHANNEL,
|
||||||
|
f"{list_id}/{channel['ccid']}",
|
||||||
|
),
|
||||||
)
|
)
|
||||||
for channel in favorites.get("channels", [])
|
for channel in favorites.get("channels", [])
|
||||||
]
|
]
|
||||||
@@ -412,7 +420,11 @@ class PhilipsTVMediaPlayer(PhilipsJsEntity, MediaPlayerEntity):
|
|||||||
if media_content_type == MediaType.APP and media_content_id:
|
if media_content_type == MediaType.APP and media_content_id:
|
||||||
return await self._tv.getApplicationIcon(media_content_id)
|
return await self._tv.getApplicationIcon(media_content_id)
|
||||||
if media_content_type == MediaType.CHANNEL and media_content_id:
|
if media_content_type == MediaType.CHANNEL and media_content_id:
|
||||||
return await self._tv.getChannelLogo(media_content_id)
|
list_id, _, channel_id = media_content_id.partition("/")
|
||||||
|
if not channel_id:
|
||||||
|
channel_id = list_id
|
||||||
|
list_id = "all"
|
||||||
|
return await self._tv.getChannelLogo(channel_id, list_id)
|
||||||
except ConnectionFailure:
|
except ConnectionFailure:
|
||||||
_LOGGER.warning("Failed to fetch image")
|
_LOGGER.warning("Failed to fetch image")
|
||||||
return None, None
|
return None, None
|
||||||
|
|||||||
Reference in New Issue
Block a user