FIX: media play

This commit is contained in:
Chris Browet 2021-06-06 19:01:46 +02:00
parent dda5322199
commit 29c3372bb5

View file

@ -31,7 +31,7 @@ from homeassistant.core import HomeAssistant, callback
import homeassistant.util.dt as dt_util import homeassistant.util.dt as dt_util
from . import JellyfinClientManager, autolog from . import JellyfinClientManager, autolog
from .media_source import async_library_items from .media_source import JellyfinSource, async_library_items
from .const import ( from .const import (
DOMAIN, DOMAIN,
@ -335,8 +335,10 @@ class JellyfinMediaPlayer(MediaPlayerEntity):
async def async_play_media(self, media_type: str, media_id: str, **kwargs) -> None: async def async_play_media(self, media_type: str, media_id: str, **kwargs) -> None:
_LOGGER.debug("Play media requested: %s / %s", media_type, media_id) _LOGGER.debug("Play media requested: %s / %s", media_type, media_id)
await self.device.play_media(media_id) _, real_media_id = JellyfinSource.parse_mediasource_identifier(media_id)
await self.device.play_media(real_media_id)
async def async_browse_item(self, id): async def async_browse_item(self, media_id):
_LOGGER.debug(f"async_browse_item triggered {id}") _LOGGER.debug(f"async_browse_item triggered {id}")
await self.device.browse_item(id) _, real_media_id = JellyfinSource.parse_mediasource_identifier(media_id)
await self.device.browse_item(real_media_id)