From 66fe13786fd29af26748b65bf70ca729b75be323 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Mon, 22 May 2017 20:54:04 +0200 Subject: [PATCH] Fix PKC syncing progress to wrong account - Fixes #297 --- resources/lib/plexbmchelper/subscribers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/lib/plexbmchelper/subscribers.py b/resources/lib/plexbmchelper/subscribers.py index 1d7a8b88..0f8c56e4 100644 --- a/resources/lib/plexbmchelper/subscribers.py +++ b/resources/lib/plexbmchelper/subscribers.py @@ -3,6 +3,7 @@ import re import threading import downloadutils +from clientinfo import getXArgsDeviceInfo from utils import window import PlexFunctions as pf import state @@ -169,6 +170,7 @@ class SubscriptionManager: # self._sendNotification(self.lastinfo[typus]) def _sendNotification(self, info): + xargs = getXArgsDeviceInfo() params = { 'containerKey': self.containerKey or "/library/metadata/900000", 'key': self.lastkey or "/library/metadata/900000", @@ -178,7 +180,7 @@ class SubscriptionManager: 'duration': info['duration'] } if state.PLEX_TRANSIENT_TOKEN: - params['token'] = state.PLEX_TRANSIENT_TOKEN + xargs['X-Plex-Token'] = state.PLEX_TRANSIENT_TOKEN if info.get('playQueueID'): params['containerKey'] = '/playQueues/%s' % info['playQueueID'] params['playQueueVersion'] = info['playQueueVersion'] @@ -187,7 +189,7 @@ class SubscriptionManager: url = '%s://%s:%s/:/timeline' % (serv.get('protocol', 'http'), serv.get('server', 'localhost'), 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" % (params, url))