Fix Plex to Cast media resuming (#76681)
This commit is contained in:
parent
7eb8e1f25d
commit
5c8bd1ec25
2 changed files with 3 additions and 2 deletions
|
@ -53,7 +53,8 @@ def _play_media(
|
|||
result = process_plex_payload(hass, media_type, media_id)
|
||||
controller = PlexController()
|
||||
chromecast.register_handler(controller)
|
||||
controller.play_media(result.media, offset=result.offset)
|
||||
offset_in_s = result.offset / 1000
|
||||
controller.play_media(result.media, offset=offset_in_s)
|
||||
|
||||
|
||||
async def async_play_media(
|
||||
|
|
|
@ -157,7 +157,7 @@ class PlexMediaSearchResult:
|
|||
|
||||
@property
|
||||
def offset(self) -> int:
|
||||
"""Provide the appropriate offset based on payload contents."""
|
||||
"""Provide the appropriate offset in ms based on payload contents."""
|
||||
if offset := self._params.get("offset", 0):
|
||||
return offset * 1000
|
||||
resume = self._params.get("resume", False)
|
||||
|
|
Loading…
Add table
Reference in a new issue