mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-24 01:36:11 +00:00
Fix user client loading user ordering
This commit is contained in:
parent
644783fae5
commit
334206b334
3 changed files with 11 additions and 9 deletions
|
@ -136,13 +136,13 @@ class DownloadUtils():
|
|||
|
||||
# User is identified from this point
|
||||
# Attach authenticated header to the session
|
||||
verify = False
|
||||
header = self.getHeader()
|
||||
|
||||
# If user enabled host certificate verification
|
||||
try:
|
||||
verify = self.sslverify
|
||||
except:
|
||||
verify = False
|
||||
log.info("Could not load SSL settings.")
|
||||
|
||||
# Start session
|
||||
|
@ -172,6 +172,7 @@ class DownloadUtils():
|
|||
auth = (
|
||||
'MediaBrowser UserId="%s", Client="Kodi", Device="%s", DeviceId="%s", Version="%s"'
|
||||
% (self.userId, deviceName, deviceId, version))
|
||||
|
||||
header = {
|
||||
|
||||
'Content-type': 'application/json',
|
||||
|
@ -185,6 +186,7 @@ class DownloadUtils():
|
|||
auth = (
|
||||
'MediaBrowser Client="Kodi", Device="%s", DeviceId="%s", Version="%s"'
|
||||
% (deviceName, deviceId, version))
|
||||
|
||||
header = {
|
||||
|
||||
'Content-type': 'application/json',
|
||||
|
|
|
@ -57,7 +57,7 @@ class InitialSetup(object):
|
|||
if server['Id'] == settings('serverId'):
|
||||
server_address = self.connectmanager.get_address(server)
|
||||
self._set_server(server_address, server)
|
||||
self._set_user(server['UserId'], server['AccessToken'])
|
||||
#self._set_user(server['UserId'], server['AccessToken'])
|
||||
break
|
||||
return
|
||||
|
||||
|
|
|
@ -159,6 +159,7 @@ class UserClient(threading.Thread):
|
|||
self._load_user()
|
||||
except Warning:
|
||||
log.info("token is invalid")
|
||||
self._reset_client()
|
||||
else:
|
||||
log.info("current user: %s", self.get_username())
|
||||
log.info("current userid: %s", self.get_userid())
|
||||
|
@ -176,7 +177,7 @@ class UserClient(threading.Thread):
|
|||
user_found = user
|
||||
break
|
||||
try:
|
||||
user = self.connectmanager.login_manual(server, user_found)
|
||||
user = connectmanager.ConnectManager().login_manual(server, user_found)
|
||||
except RuntimeError:
|
||||
window('emby_serverStatus', value="stop")
|
||||
self._auth = False
|
||||
|
@ -219,17 +220,17 @@ class UserClient(threading.Thread):
|
|||
doutils.setToken(token)
|
||||
doutils.setSSL(self.get_ssl())
|
||||
|
||||
# Start downloadutils.py session
|
||||
doutils.startSession()
|
||||
|
||||
# Set _user and _server
|
||||
self._set_user_server()
|
||||
# verify user access
|
||||
try:
|
||||
self._set_access()
|
||||
except Warning: # We don't need to raise any exceptions
|
||||
pass
|
||||
|
||||
# Start downloadutils.py session
|
||||
doutils.startSession()
|
||||
# Set _user and _server
|
||||
self._set_user_server()
|
||||
|
||||
def _reset_client(self):
|
||||
|
||||
log.info("reset UserClient authentication")
|
||||
|
@ -245,7 +246,6 @@ class UserClient(threading.Thread):
|
|||
def run(self):
|
||||
|
||||
monitor = xbmc.Monitor()
|
||||
self.connectmanager = connectmanager.ConnectManager()
|
||||
|
||||
log.warn("----===## Starting UserClient ##===----")
|
||||
|
||||
|
|
Loading…
Reference in a new issue