Switch to state variables
This commit is contained in:
parent
73ce4eeacb
commit
962ce6da1e
3 changed files with 7 additions and 2 deletions
|
@ -12,6 +12,7 @@ from utils import window, settings, tryEncode, language as lang, dialog
|
||||||
from PlexFunctions import GetMachineIdentifier, get_pms_settings, \
|
from PlexFunctions import GetMachineIdentifier, get_pms_settings, \
|
||||||
check_connection
|
check_connection
|
||||||
import variables as v
|
import variables as v
|
||||||
|
import state
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
@ -100,8 +101,8 @@ class ConnectManager(object):
|
||||||
dia = ServerConnect("script-plex-connect-server.xml", *XML_PATH)
|
dia = ServerConnect("script-plex-connect-server.xml", *XML_PATH)
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'connect_manager': None, # self._connect
|
'connect_manager': None, # self._connect
|
||||||
'username': settings('username'),
|
'username': state.PLEX_USERNAME,
|
||||||
'user_image': window('PlexUserImage'),
|
'user_image': state.PLEX_USER_IMAGE,
|
||||||
# 'servers': state.get('Servers') or [],
|
# 'servers': state.get('Servers') or [],
|
||||||
# 'emby_connect': False if user else True
|
# 'emby_connect': False if user else True
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,8 @@ INDICATE_MEDIA_VERSIONS = False
|
||||||
AUTHENTICATED = False
|
AUTHENTICATED = False
|
||||||
# plex.tv username
|
# plex.tv username
|
||||||
PLEX_USERNAME = None
|
PLEX_USERNAME = None
|
||||||
|
# plex.tv image for this user
|
||||||
|
PLEX_USER_IMAGE = None
|
||||||
# Token for that user for plex.tv
|
# Token for that user for plex.tv
|
||||||
PLEX_TOKEN = None
|
PLEX_TOKEN = None
|
||||||
# Plex ID of that user (e.g. for plex.tv) as a STRING
|
# Plex ID of that user (e.g. for plex.tv) as a STRING
|
||||||
|
|
|
@ -111,6 +111,7 @@ class UserClient(threading.Thread):
|
||||||
url = get_user_artwork_url(self.currUser)
|
url = get_user_artwork_url(self.currUser)
|
||||||
if url:
|
if url:
|
||||||
window('PlexUserImage', value=url)
|
window('PlexUserImage', value=url)
|
||||||
|
state.PLEX_USER_IMAGE = url
|
||||||
# Set resume point max
|
# Set resume point max
|
||||||
# url = "{server}/emby/System/Configuration?format=json"
|
# url = "{server}/emby/System/Configuration?format=json"
|
||||||
# result = doUtils.downloadUrl(url)
|
# result = doUtils.downloadUrl(url)
|
||||||
|
@ -282,6 +283,7 @@ class UserClient(threading.Thread):
|
||||||
window('plex_servername', clear=True)
|
window('plex_servername', clear=True)
|
||||||
state.PLEX_USER_ID = None
|
state.PLEX_USER_ID = None
|
||||||
state.PLEX_USERNAME = None
|
state.PLEX_USERNAME = None
|
||||||
|
state.PLEX_USER_IMAGE = None
|
||||||
window('plex_restricteduser', clear=True)
|
window('plex_restricteduser', clear=True)
|
||||||
state.RESTRICTED_USER = False
|
state.RESTRICTED_USER = False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue