Rename Plex user id

This commit is contained in:
tomkat83 2017-05-17 16:15:16 +02:00
parent 9ae68b66f7
commit f7da47f2d5
4 changed files with 8 additions and 8 deletions

View File

@ -1352,13 +1352,13 @@ class LibrarySync(Thread):
# Hence must be us (since several users require plex.tv
# token for PKC)
pass
elif not (currSess['userId'] == state.CURRENT_USER_ID
elif not (currSess['userId'] == state.PLEX_USER_ID
or
currSess['username'] == state.PLEX_USERNAME):
log.debug('Our username %s, userid %s did not match '
'the session username %s with userid %s'
% (state.PLEX_USERNAME,
state.CURRENT_USER_ID,
state.PLEX_USER_ID,
currSess['username'],
currSess['userId']))
continue
@ -1397,7 +1397,7 @@ class LibrarySync(Thread):
})
log.debug('Update playstate for user %s with id %s: %s'
% (state.PLEX_USERNAME,
state.CURRENT_USER_ID,
state.PLEX_USER_ID,
items[-1]))
# Now tell Kodi where we are
for item in items:

View File

@ -28,4 +28,4 @@ AUTHENTICATED = False
PLEX_TOKEN = None
# Plex ID of the current user (e.g. for plex.tv) as a STRING
PLEX_USERNAME = None
CURRENT_USER_ID = None
PLEX_USER_ID = None

View File

@ -142,7 +142,7 @@ class UserClient(threading.Thread):
return False
# Set to windows property
state.CURRENT_USER_ID = userId or None
state.PLEX_USER_ID = userId or None
state.PLEX_USERNAME = username
# This is the token for the current PMS (might also be '')
window('pms_token', value=self.currToken)
@ -274,7 +274,7 @@ class UserClient(threading.Thread):
window('pms_server', clear=True)
window('plex_machineIdentifier', clear=True)
window('plex_servername', clear=True)
state.CURRENT_USER_ID = None
state.PLEX_USER_ID = None
state.PLEX_USERNAME = None
window('plex_restricteduser', clear=True)
state.RESTRICTED_USER = False
@ -328,7 +328,7 @@ class UserClient(threading.Thread):
# Successfully authenticated and loaded a user
log.info("Successfully authenticated!")
log.info("Current user: %s" % self.currUser)
log.info("Current userId: %s" % state.CURRENT_USER_ID)
log.info("Current userId: %s" % state.PLEX_USER_ID)
self.retry = 0
state.SUSPEND_LIBRARY_THREAD = False
window('plex_serverStatus', clear=True)

View File

@ -221,7 +221,7 @@ class Alexa_Websocket(WebSocket):
def getUri(self):
self.plex_client_Id = window('plex_client_Id')
uri = ('wss://pubsub.plex.tv/sub/websockets/%s/%s?X-Plex-Token=%s'
% (state.CURRENT_USER_ID,
% (state.PLEX_USER_ID,
self.plex_client_Id, state.PLEX_TOKEN))
sslopt = {}
log.debug("Uri: %s, sslopt: %s" % (uri, sslopt))