Fix Plex to Cast media resuming (#76681)

This commit is contained in:
jjlawren 2022-08-28 17:51:20 -05:00 committed by GitHub
parent 7eb8e1f25d
commit 5c8bd1ec25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -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(

View file

@ -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)