Fix getting user artwork

This commit is contained in:
tomkat83 2015-12-28 11:04:28 +01:00
parent 92eac70c0b
commit ce6a9ca926

View file

@ -198,16 +198,9 @@ class UserClient(threading.Thread):
def setUserPref(self): def setUserPref(self):
doUtils = self.doUtils
art = artwork.Artwork()
url = PlexAPI.PlexAPI().GetUserArtworkURL(self.currUser) url = PlexAPI.PlexAPI().GetUserArtworkURL(self.currUser)
if url: if url:
result = doUtils.downloadUrl(url, authenticate=False) utils.window('EmbyUserImage', value=url)
self.userSettings = result
# Set user image for skin display
if result.get('PrimaryImageTag'):
utils.window('EmbyUserImage', value=art.getUserArtwork(result['Id'], 'Primary'))
# 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)
@ -229,24 +222,7 @@ class UserClient(threading.Thread):
return False return False
def hasAccess(self): def hasAccess(self):
# hasAccess is verified in service.py return True
url = "{server}/emby/Users?format=json"
result = self.doUtils.downloadUrl(url)
if result == False:
# Access is restricted, set in downloadutils.py via exception
self.logMsg("Access is restricted.", 1)
self.HasAccess = False
elif utils.window('emby_online') != "true":
# Server connection failed
pass
elif utils.window('emby_serverStatus') == "restricted":
self.logMsg("Access is granted.", 1)
self.HasAccess = True
utils.window('emby_serverStatus', clear=True)
xbmcgui.Dialog().notification("Emby server", "Access is enabled.")
def loadCurrUser(self, authenticated=False): def loadCurrUser(self, authenticated=False):
@ -294,7 +270,7 @@ class UserClient(threading.Thread):
# Set user preferences in settings # Set user preferences in settings
self.currUser = username self.currUser = username
self.setUserPref() self.setUserPref()
return True
def authenticate(self): def authenticate(self):
# Get /profile/addon_data # Get /profile/addon_data