Fix rare case when playback would not start-up

This commit is contained in:
croneter 2018-10-04 19:48:13 +02:00
parent be57db9200
commit 0d0a5948ac

View file

@ -57,6 +57,7 @@ def playback_triage(plex_id=None, plex_type=None, path=None, resolve=True):
utils.dialog('notification', utils.lang(29999), utils.lang(30017))
_ensure_resolve(abort=True)
return
with state.LOCK_PLAYQUEUES:
playqueue = PQ.get_playqueue_from_type(
v.KODI_PLAYLIST_TYPE_FROM_PLEX_TYPE[plex_type])
try:
@ -64,7 +65,7 @@ def playback_triage(plex_id=None, plex_type=None, path=None, resolve=True):
except KeyError:
# Kodi bug - Playlist plays (not Playqueue) will ALWAYS be audio for
# add-on paths
LOG.info('No position returned from Kodi player! Assuming playlist')
LOG.info('No position returned from player! Assuming playlist')
playqueue = PQ.get_playqueue_from_type(v.KODI_PLAYLIST_TYPE_AUDIO)
try:
pos = js.get_position(playqueue.playlistid)
@ -106,12 +107,11 @@ def playback_triage(plex_id=None, plex_type=None, path=None, resolve=True):
initiate = True
else:
if item.plex_id != plex_id:
LOG.debug('Received new plex_id %s, expected %s. Init playback',
LOG.debug('Received new plex_id %s, expected %s',
plex_id, item.plex_id)
initiate = True
else:
initiate = False
with state.LOCK_PLAYQUEUES:
if initiate:
_playback_init(plex_id, plex_type, playqueue, pos)
else: