Fix PKC syncing progress to wrong account

- Fixes #297
This commit is contained in:
tomkat83 2017-05-22 20:54:04 +02:00
parent 845885edbd
commit 66fe13786f

View file

@ -3,6 +3,7 @@ import re
import threading import threading
import downloadutils import downloadutils
from clientinfo import getXArgsDeviceInfo
from utils import window from utils import window
import PlexFunctions as pf import PlexFunctions as pf
import state import state
@ -169,6 +170,7 @@ class SubscriptionManager:
# self._sendNotification(self.lastinfo[typus]) # self._sendNotification(self.lastinfo[typus])
def _sendNotification(self, info): def _sendNotification(self, info):
xargs = getXArgsDeviceInfo()
params = { params = {
'containerKey': self.containerKey or "/library/metadata/900000", 'containerKey': self.containerKey or "/library/metadata/900000",
'key': self.lastkey or "/library/metadata/900000", 'key': self.lastkey or "/library/metadata/900000",
@ -178,7 +180,7 @@ class SubscriptionManager:
'duration': info['duration'] 'duration': info['duration']
} }
if state.PLEX_TRANSIENT_TOKEN: if state.PLEX_TRANSIENT_TOKEN:
params['token'] = state.PLEX_TRANSIENT_TOKEN xargs['X-Plex-Token'] = state.PLEX_TRANSIENT_TOKEN
if info.get('playQueueID'): if info.get('playQueueID'):
params['containerKey'] = '/playQueues/%s' % info['playQueueID'] params['containerKey'] = '/playQueues/%s' % info['playQueueID']
params['playQueueVersion'] = info['playQueueVersion'] params['playQueueVersion'] = info['playQueueVersion']
@ -187,7 +189,7 @@ class SubscriptionManager:
url = '%s://%s:%s/:/timeline' % (serv.get('protocol', 'http'), url = '%s://%s:%s/:/timeline' % (serv.get('protocol', 'http'),
serv.get('server', 'localhost'), serv.get('server', 'localhost'),
serv.get('port', '32400')) serv.get('port', '32400'))
self.doUtils(url, parameters=params) self.doUtils(url, parameters=params, headerOptions=xargs)
log.debug("Sent server notification with parameters: %s to %s" log.debug("Sent server notification with parameters: %s to %s"
% (params, url)) % (params, url))