Fix using plex instead of user token

- Fixes #407
This commit is contained in:
croneter 2018-02-14 20:38:50 +01:00
parent feb91127cd
commit 66b8559eab
3 changed files with 8 additions and 3 deletions

View file

@ -388,8 +388,8 @@ class SubscriptionMgr(object):
xargs['X-Plex-Token'] = state.PLEX_TRANSIENT_TOKEN
elif playqueue.plex_transient_token:
xargs['X-Plex-Token'] = playqueue.plex_transient_token
elif state.PLEX_TOKEN:
xargs['X-Plex-Token'] = state.PLEX_TOKEN
elif state.PMS_TOKEN:
xargs['X-Plex-Token'] = state.PMS_TOKEN
url = '%s://%s:%s/:/timeline' % (serv.get('protocol', 'http'),
serv.get('server', 'localhost'),
serv.get('port', '32400'))

View file

@ -75,6 +75,9 @@ AUTHENTICATED = False
PLEX_USERNAME = None
# Token for that user for plex.tv
PLEX_TOKEN = None
# Plex token for the active PMS for the active user
# (might be diffent to PLEX_TOKEN)
PMS_TOKEN = None
# Plex ID of that user (e.g. for plex.tv) as a STRING
PLEX_USER_ID = None
# Token passed along, e.g. if playback initiated by Plex Companion. Might be

View file

@ -141,7 +141,8 @@ class UserClient(Thread):
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)
window('pms_token', value=usertoken)
state.PMS_TOKEN = usertoken
# This is the token for plex.tv for the current user
# Is only '' if user is not signed in to plex.tv
window('plex_token', value=settings('plexToken'))
@ -264,6 +265,7 @@ class UserClient(Thread):
window('pms_token', clear=True)
state.PLEX_TOKEN = None
state.PLEX_TRANSIENT_TOKEN = None
state.PMS_TOKEN = None
window('plex_token', clear=True)
window('pms_server', clear=True)
window('plex_machineIdentifier', clear=True)