Always resume playback if playback initiated via context menu
This commit is contained in:
parent
491aa32586
commit
1d718c99c6
1 changed files with 6 additions and 3 deletions
|
@ -136,16 +136,19 @@ def _playback_init(plex_id, plex_type, playqueue, pos):
|
||||||
# Sleep a bit to let setResolvedUrl do its thing - bit ugly
|
# Sleep a bit to let setResolvedUrl do its thing - bit ugly
|
||||||
sleep(200)
|
sleep(200)
|
||||||
_process_stack(playqueue, stack)
|
_process_stack(playqueue, stack)
|
||||||
|
# Always resume if playback initiated via PMS and there IS a resume
|
||||||
|
# point
|
||||||
|
offset = api.resume_point() * 1000 if state.CONTEXT_MENU_PLAY else None
|
||||||
# Reset some playback variables
|
# Reset some playback variables
|
||||||
state.CONTEXT_MENU_PLAY = False
|
state.CONTEXT_MENU_PLAY = False
|
||||||
state.FORCE_TRANSCODE = False
|
state.FORCE_TRANSCODE = False
|
||||||
# Do NOT set offset, because Kodi player will return here to resolveURL
|
# Do NOT set offset, because Kodi player will return here to resolveURL
|
||||||
# New thread to release this one sooner (e.g. harddisk spinning up)
|
# New thread to release this one sooner (e.g. harddisk spinning up)
|
||||||
thread = Thread(target=threaded_playback,
|
thread = Thread(target=threaded_playback,
|
||||||
args=(playqueue.kodi_pl, pos, None))
|
args=(playqueue.kodi_pl, pos, offset))
|
||||||
thread.setDaemon(True)
|
thread.setDaemon(True)
|
||||||
LOG.info('Done initializing playback, starting Kodi player at pos %s',
|
LOG.info('Done initializing playback, starting Kodi player at pos %s and '
|
||||||
pos)
|
'resume point %s', pos, offset)
|
||||||
# By design, PKC will start Kodi playback using Player().play(). Kodi
|
# By design, PKC will start Kodi playback using Player().play(). Kodi
|
||||||
# caches paths like our plugin://pkc. If we use Player().play() between
|
# caches paths like our plugin://pkc. If we use Player().play() between
|
||||||
# 2 consecutive startups of exactly the same Kodi library item, Kodi's
|
# 2 consecutive startups of exactly the same Kodi library item, Kodi's
|
||||||
|
|
Loading…
Reference in a new issue