Move plex_playbackProbs to state.py

This commit is contained in:
tomkat83 2018-01-06 12:55:24 +01:00
parent 546e79d925
commit e0f1225c21
3 changed files with 9 additions and 10 deletions

View file

@ -113,8 +113,8 @@ class PlaybackUtils():
# We need to ensure we add the intro and additional parts only once. # We need to ensure we add the intro and additional parts only once.
# Otherwise we get a loop. # Otherwise we get a loop.
if not v.PLAYBACK_SETUP_DONE: if not state.PLAYBACK_SETUP_DONE:
v.PLAYBACK_SETUP_DONE = True state.PLAYBACK_SETUP_DONE = True
LOG.info("Setting up properties in playlist.") LOG.info("Setting up properties in playlist.")
# Where will the player need to start? # Where will the player need to start?
# Do we need to get trailers? # Do we need to get trailers?
@ -139,7 +139,6 @@ class PlaybackUtils():
get_playlist_details_from_xml(playqueue, xml=xml) get_playlist_details_from_xml(playqueue, xml=xml)
except KeyError: except KeyError:
return return
playqueue.items.append(playlist_item_from_xml(playqueue, xml[0]))
if (not homeScreen and not seektime and sizePlaylist < 2 and if (not homeScreen and not seektime and sizePlaylist < 2 and
window('plex_customplaylist') != "true" and window('plex_customplaylist') != "true" and
@ -199,7 +198,7 @@ class PlaybackUtils():
api.set_listitem_artwork(listitem) api.set_listitem_artwork(listitem)
add_listitem_to_Kodi_playlist( add_listitem_to_Kodi_playlist(
playqueue, playqueue,
self.currentPosition+1, self.currentPosition,
convert_PKC_to_listitem(listitem), convert_PKC_to_listitem(listitem),
file=playurl, file=playurl,
kodi_item={'id': kodi_id, 'type': kodi_type}) kodi_item={'id': kodi_id, 'type': kodi_type})
@ -207,7 +206,7 @@ class PlaybackUtils():
# Full metadata$ # Full metadata$
add_item_to_kodi_playlist( add_item_to_kodi_playlist(
playqueue, playqueue,
self.currentPosition+1, self.currentPosition,
kodi_id, kodi_id,
kodi_type) kodi_type)
self.currentPosition += 1 self.currentPosition += 1
@ -231,9 +230,9 @@ class PlaybackUtils():
return result return result
# We just skipped adding properties. Reset flag for next time. # We just skipped adding properties. Reset flag for next time.
elif v.PLAYBACK_SETUP_DONE: elif state.PLAYBACK_SETUP_DONE:
LOG.debug("Resetting properties playback flag.") LOG.debug("Resetting properties playback flag.")
v.PLAYBACK_SETUP_DONE = False state.PLAYBACK_SETUP_DONE = False
# SETUP MAIN ITEM ########## # SETUP MAIN ITEM ##########
# For transcoding only, ask for audio/subs pref # For transcoding only, ask for audio/subs pref
@ -276,7 +275,7 @@ class PlaybackUtils():
Play all items contained in the xml passed in. Called by Plex Companion Play all items contained in the xml passed in. Called by Plex Companion
""" """
LOG.info("Playbackutils play_all called") LOG.info("Playbackutils play_all called")
v.PLAYBACK_SETUP_DONE = True state.PLAYBACK_SETUP_DONE = True
self.currentPosition = 0 self.currentPosition = 0
for item in self.xml: for item in self.xml:
api = API(item) api = API(item)

View file

@ -268,7 +268,7 @@ class PKC_Player(Player):
# We might have saved a transient token from a user flinging media via # We might have saved a transient token from a user flinging media via
# Companion (if we could not use the playqueue to store the token) # Companion (if we could not use the playqueue to store the token)
state.PLEX_TRANSIENT_TOKEN = None state.PLEX_TRANSIENT_TOKEN = None
v.PLAYBACK_SETUP_DONE = False state.PLAYBACK_SETUP_DONE = False
LOG.debug("Cleared playlist properties.") LOG.debug("Cleared playlist properties.")
def onPlayBackEnded(self): def onPlayBackEnded(self):

View file

@ -108,7 +108,7 @@ class Service():
"plex_online", "plex_serverStatus", "plex_onWake", "plex_online", "plex_serverStatus", "plex_onWake",
"plex_kodiScan", "plex_kodiScan",
"plex_shouldStop", "plex_dbScan", "plex_shouldStop", "plex_dbScan",
"plex_initialScan", "plex_customplayqueue", "plex_initialScan", "plex_customplayqueue", "plex_playbackProps",
"pms_token", "plex_token", "pms_token", "plex_token",
"pms_server", "plex_machineIdentifier", "plex_servername", "pms_server", "plex_machineIdentifier", "plex_servername",
"plex_authenticated", "PlexUserImage", "useDirectPaths", "plex_authenticated", "PlexUserImage", "useDirectPaths",