Minor Plex Companion improvements

This commit is contained in:
croneter 2017-12-05 11:14:41 +01:00
parent 9052b84011
commit 116a2956ac

View file

@ -69,13 +69,14 @@ class SubscriptionManager:
if playerid is not None: if playerid is not None:
info = self.getPlayerProperties(playerid) info = self.getPlayerProperties(playerid)
# save this info off so the server update can use it too # save this info off so the server update can use it too
self.playerprops[playerid] = info; self.playerprops[playerid] = info
status = info['state'] status = info['state']
time = info['time'] time = info['time']
else: else:
status = "stopped" status = "stopped"
time = 0 time = 0
ret = "\n"+' <Timeline state="%s" time="%s" type="%s"' % (status, time, ptype) ret = ('\n <Timeline state="%s" time="%s" type="%s"'
% (status, time, ptype))
if playerid is None: if playerid is None:
ret += ' />' ret += ' />'
return ret return ret
@ -120,7 +121,7 @@ class SubscriptionManager:
ret += ' shuffle="%s"' % info['shuffle'] ret += ' shuffle="%s"' % info['shuffle']
ret += ' mute="%s"' % self.mute ret += ' mute="%s"' % self.mute
ret += ' repeat="%s"' % info['repeat'] ret += ' repeat="%s"' % info['repeat']
ret += ' itemType="%s"' % info['itemType'] ret += ' itemType="%s"' % ptype
if state.PLEX_TRANSIENT_TOKEN: if state.PLEX_TRANSIENT_TOKEN:
ret += ' token="%s"' % state.PLEX_TRANSIENT_TOKEN ret += ' token="%s"' % state.PLEX_TRANSIENT_TOKEN
elif info['plex_transient_token']: elif info['plex_transient_token']:
@ -241,7 +242,6 @@ class SubscriptionManager:
"speed", "speed",
"shuffled", "shuffled",
"repeat"]}) "repeat"]})
info = { info = {
'time': timeToMillis(props['time']), 'time': timeToMillis(props['time']),
'duration': timeToMillis(props['totaltime']), 'duration': timeToMillis(props['totaltime']),