From 0e15daa37a6890866aef5a63b795e0ae47c70c63 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Thu, 24 Dec 2015 16:16:58 -0600 Subject: [PATCH] Fix user image --- resources/lib/entrypoint.py | 10 ++++++---- resources/lib/userclient.py | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index 588b8d3c..10d608ed 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -94,6 +94,7 @@ def doMainListing(): def addUser(): doUtils = downloadutils.DownloadUtils() + art = artwork.Artwork() clientInfo = clientinfo.ClientInfo() deviceId = clientInfo.getDeviceId() deviceName = clientInfo.getDeviceName() @@ -195,18 +196,19 @@ def addUser(): for i in range(totalNodes): if not utils.window('EmbyAdditionalUserImage.%s' % i): break - utils.window('EmbyAdditionalUserImage.%s' % i) + utils.window('EmbyAdditionalUserImage.%s' % i, clear=True) url = "{server}/emby/Sessions?DeviceId=%s" % deviceId result = doUtils.downloadUrl(url) additionalUsers = result[0]['AdditionalUsers'] count = 0 for additionaluser in additionalUsers: - url = "{server}/emby/Users/%s?format=json" % additionaluser['UserId'] + userid = additionaluser['UserId'] + url = "{server}/emby/Users/%s?format=json" % userid result = doUtils.downloadUrl(url) utils.window('EmbyAdditionalUserImage.%s' % count, - value=artwork.Artwork().getUserArtwork(result, 'Primary')) - utils.window('EmbyAdditionalUserPosition.%s' % additionaluser['UserId'], value=str(count)) + value=art.getUserArtwork(result['Id'], 'Primary')) + utils.window('EmbyAdditionalUserPosition.%s' % userid, value=str(count)) count +=1 ##### THEME MUSIC/VIDEOS ##### diff --git a/resources/lib/userclient.py b/resources/lib/userclient.py index a6562a53..035cf784 100644 --- a/resources/lib/userclient.py +++ b/resources/lib/userclient.py @@ -188,13 +188,14 @@ class UserClient(threading.Thread): def setUserPref(self): doUtils = self.doUtils + art = artwork.Artwork() url = "{server}/emby/Users/{UserId}?format=json" result = doUtils.downloadUrl(url) self.userSettings = result # Set user image for skin display if result.get('PrimaryImageTag'): - utils.window('EmbyUserImage', value=artwork.Artwork().getUserArtwork(result, 'Primary')) + utils.window('EmbyUserImage', value=art.getUserArtwork(result['Id'], 'Primary')) # Set resume point max url = "{server}/emby/System/Configuration?format=json"