From fc386221f3ada92d360b997d888c1154fe90297a Mon Sep 17 00:00:00 2001 From: Chris Browet Date: Sun, 19 Dec 2021 09:54:52 +0100 Subject: [PATCH] FIX: browse service --- custom_components/jellyfin/media_player.py | 4 ++-- custom_components/jellyfin/media_source.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/custom_components/jellyfin/media_player.py b/custom_components/jellyfin/media_player.py index fb3139a..73e0392 100644 --- a/custom_components/jellyfin/media_player.py +++ b/custom_components/jellyfin/media_player.py @@ -338,7 +338,7 @@ class JellyfinMediaPlayer(MediaPlayerEntity): _, real_media_id = JellyfinSource.parse_mediasource_identifier(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}") - _, 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) diff --git a/custom_components/jellyfin/media_source.py b/custom_components/jellyfin/media_source.py index 0207eac..b37f43b 100644 --- a/custom_components/jellyfin/media_source.py +++ b/custom_components/jellyfin/media_source.py @@ -96,8 +96,10 @@ class JellyfinSource(MediaSource): text = identifier if identifier.startswith(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): """Initialize Netatmo source."""