From 05aa97c0adc73fd01c0380313d34b2cca8a33ae6 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sun, 14 May 2017 16:39:19 +0200 Subject: [PATCH] Revert "Also check authentication via state" This reverts commit e5a422635d78dce6e10da947cd39a9c43c24c6ce. --- resources/lib/playback_starter.py | 3 +-- resources/lib/state.py | 2 -- resources/lib/userclient.py | 2 -- service.py | 2 +- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/resources/lib/playback_starter.py b/resources/lib/playback_starter.py index f0ac27f5..836f587d 100644 --- a/resources/lib/playback_starter.py +++ b/resources/lib/playback_starter.py @@ -17,7 +17,6 @@ import variables as v from downloadutils import DownloadUtils from PKC_listitem import convert_PKC_to_listitem import plexdb_functions as plexdb -import state ############################################################################### log = logging.getLogger("PLEX."+__name__) @@ -40,7 +39,7 @@ class Playback_Starter(Thread): """ log.info("Process_play called with plex_id %s, kodi_id %s" % (plex_id, kodi_id)) - if not state.AUTHENTICATED: + if window('plex_authenticated') != "true": log.error('Not yet authenticated for PMS, abort starting playback') # Todo: Warn user with dialog return diff --git a/resources/lib/state.py b/resources/lib/state.py index 6d9df0be..9fffcaea 100644 --- a/resources/lib/state.py +++ b/resources/lib/state.py @@ -19,6 +19,4 @@ SUSPEND_USER_CLIENT = False # Plex home user? Then "False". Along with window('plex_restricteduser') RESTRICTED_USER = False -# Along with window('plex_authenticated') -AUTHENTICATED = False PLEX_TOKEN = None diff --git a/resources/lib/userclient.py b/resources/lib/userclient.py index d26ab694..d8fdc965 100644 --- a/resources/lib/userclient.py +++ b/resources/lib/userclient.py @@ -159,7 +159,6 @@ class UserClient(threading.Thread): window('plex_machineIdentifier', value=self.machineIdentifier) window('plex_servername', value=self.servername) window('plex_authenticated', value='true') - state.AUTHENTICATED = True window('useDirectPaths', value='true' if settings('useDirectPaths') == "1" else 'false') @@ -267,7 +266,6 @@ class UserClient(threading.Thread): self.doUtils.stopSession() window('plex_authenticated', clear=True) - state.AUTHENTICATED = False window('pms_token', clear=True) state.PLEX_TOKEN = None window('plex_token', clear=True) diff --git a/service.py b/service.py index a37d60c1..0bfd43b7 100644 --- a/service.py +++ b/service.py @@ -303,7 +303,7 @@ class Service(): sound=False) log.info("Server %s is online and ready." % server) window('plex_online', value="true") - if state.AUTHENTICATED: + if window('plex_authenticated') == 'true': # Server got offline when we were authenticated. # Hence resume threads state.SUSPEND_LIBRARY_THREAD = False