Fix Plex Companion crashing when connected to Plex Web

This commit is contained in:
croneter 2018-07-08 12:53:03 +02:00
parent bd34ee20e3
commit c557cbdb93

View file

@ -114,6 +114,7 @@ class SubscriptionMgr(object):
self.server = "" self.server = ""
self.protocol = "http" self.protocol = "http"
self.port = "" self.port = ""
self.isplaying = False
self.location = 'navigation' self.location = 'navigation'
# In order to be able to signal a stop at the end # In order to be able to signal a stop at the end
self.last_params = {} self.last_params = {}
@ -150,6 +151,7 @@ class SubscriptionMgr(object):
Returns a timeline xml as str Returns a timeline xml as str
(xml containing video, audio, photo player state) (xml containing video, audio, photo player state)
""" """
self.isplaying = False
self.location = 'navigation' self.location = 'navigation'
answ = str(XML) answ = str(XML)
timelines = { timelines = {
@ -198,10 +200,11 @@ class SubscriptionMgr(object):
'type': ptype, 'type': ptype,
'state': 'stopped' 'state': 'stopped'
} }
self.isplaying = True
self.stop_sent_to_web = False
if ptype in (v.PLEX_PLAYLIST_TYPE_VIDEO, if ptype in (v.PLEX_PLAYLIST_TYPE_VIDEO,
v.PLEX_PLAYLIST_TYPE_PHOTO): v.PLEX_PLAYLIST_TYPE_PHOTO):
self.location = 'fullScreenVideo' self.location = 'fullScreenVideo'
self.stop_sent_to_web = False
pbmc_server = utils.window('pms_server') pbmc_server = utils.window('pms_server')
if pbmc_server: if pbmc_server:
(self.protocol, self.server, self.port) = pbmc_server.split(':') (self.protocol, self.server, self.port) = pbmc_server.split(':')