Merge pull request #574 from mcarlton00/cast-resume

Resume media when possible during casting
This commit is contained in:
mcarlton00 2021-10-06 19:06:23 -04:00 committed by GitHub
commit 133e408eb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -181,6 +181,10 @@ class Actions(object):
listitem = xbmcgui.ListItem() listitem = xbmcgui.ListItem()
LOG.info("[ playlist/%s ] %s", item['Id'], item['Name']) LOG.info("[ playlist/%s ] %s", item['Id'], item['Name'])
# Automatically resume if the item is in progress (casting from server)
resume = item['UserData'].get('PlaybackPositionTicks')
item["resumePlayback"] = bool(resume)
play = playutils.PlayUtils(item, False, self.server_id, self.server, self.api_client) play = playutils.PlayUtils(item, False, self.server_id, self.server, self.api_client)
source = play.select_source(play.get_sources()) source = play.select_source(play.get_sources())
play.set_external_subs(source, listitem) play.set_external_subs(source, listitem)