Rewire plex.playlist.audio

This commit is contained in:
croneter 2019-04-07 13:33:00 +02:00
parent 439857a9ce
commit 797a58a3d5
4 changed files with 7 additions and 4 deletions

View file

@ -59,6 +59,9 @@ class PlayState(object):
self.resume_playback = None self.resume_playback = None
# Don't ask user whether to resume but immediatly resume # Don't ask user whether to resume but immediatly resume
self.autoplay = False self.autoplay = False
# Are we using the Kodi audio playlist (=True, e.g. for videos when
# starting from a widget!) or video playlist (=False)?
self.audioplaylist = None
# Was the playback initiated by the user using the Kodi context menu? # Was the playback initiated by the user using the Kodi context menu?
self.context_menu_play = False self.context_menu_play = False
# Set by context menu - shall we force-transcode the next playing item? # Set by context menu - shall we force-transcode the next playing item?

View file

@ -184,9 +184,9 @@ class KodiMonitor(xbmc.Monitor):
''' '''
if data['position'] == 0: if data['position'] == 0:
if data['playlistid'] == 0: if data['playlistid'] == 0:
utils.window('plex.playlist.audio', value='true') app.PLAYSTATE.audioplaylist = True
else: else:
utils.window('plex.playlist.audio', clear=True) app.PLAYSTATE.audioplaylist = False
self.playlistid = data['playlistid'] self.playlistid = data['playlistid']
if utils.window('plex.playlist.start') and data['position'] == int(utils.window('plex.playlist.start')) + 1: if utils.window('plex.playlist.start') and data['position'] == int(utils.window('plex.playlist.start')) + 1:
LOG.info('Playlist ready') LOG.info('Playlist ready')

View file

@ -52,7 +52,7 @@ class PlayStrm(object):
self.transcode = params.get('transcode') self.transcode = params.get('transcode')
if self.transcode is None: if self.transcode is None:
self.transcode = utils.settings('playFromTranscode.bool') if utils.settings('playFromStream.bool') else None self.transcode = utils.settings('playFromTranscode.bool') if utils.settings('playFromStream.bool') else None
if utils.window('plex.playlist.audio'): if app.PLAYSTATE.audioplaylist:
LOG.debug('Audio playlist detected') LOG.debug('Audio playlist detected')
self.playqueue = PQ.get_playqueue_from_type(v.KODI_TYPE_AUDIO) self.playqueue = PQ.get_playqueue_from_type(v.KODI_TYPE_AUDIO)
else: else:

View file

@ -330,7 +330,7 @@ class QueuePlay(backgroundthread.KillableThread):
utils.window('plex.playlist.ready', clear=True) utils.window('plex.playlist.ready', clear=True)
utils.window('plex.playlist.start', clear=True) utils.window('plex.playlist.start', clear=True)
utils.window('plex.playlist.audio', clear=True) app.PLAYSTATE.audioplaylist = None
self.server.threads.remove(self) self.server.threads.remove(self)
self.server.pending = [] self.server.pending = []
LOG.info('##===---- QueuePlay Stopped ----===##') LOG.info('##===---- QueuePlay Stopped ----===##')