FIX: browse service

This commit is contained in:
Chris Browet 2021-12-19 09:54:52 +01:00
parent dc7c37dde1
commit fc386221f3
2 changed files with 5 additions and 3 deletions

View file

@ -338,7 +338,7 @@ class JellyfinMediaPlayer(MediaPlayerEntity):
_, real_media_id = JellyfinSource.parse_mediasource_identifier(media_id) _, real_media_id = JellyfinSource.parse_mediasource_identifier(media_id)
await self.device.play_media(real_media_id) await self.device.play_media(real_media_id)
async def async_browse_item(self, media_id): async def async_browse_item(self, id):
_LOGGER.debug(f"async_browse_item triggered {id}") _LOGGER.debug(f"async_browse_item triggered {id}")
_, real_media_id = JellyfinSource.parse_mediasource_identifier(media_id) _, real_media_id = JellyfinSource.parse_mediasource_identifier(id)
await self.device.browse_item(real_media_id) await self.device.browse_item(real_media_id)

View file

@ -96,8 +96,10 @@ class JellyfinSource(MediaSource):
text = identifier text = identifier
if identifier.startswith(prefix): if identifier.startswith(prefix):
text = identifier[len(prefix):] text = identifier[len(prefix):]
if IDENTIFIER_SPLIT in text:
return text.split(IDENTIFIER_SPLIT, 2)
return text.split(IDENTIFIER_SPLIT, 2) return "", text
def __init__(self, hass: HomeAssistant, manager: JellyfinClientManager): def __init__(self, hass: HomeAssistant, manager: JellyfinClientManager):
"""Initialize Netatmo source.""" """Initialize Netatmo source."""