Revert "Also check authentication via state"

This reverts commit e5a422635d.
This commit is contained in:
tomkat83 2017-05-14 16:39:19 +02:00
parent e5a422635d
commit 05aa97c0ad
4 changed files with 2 additions and 7 deletions

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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