Fix user image

This commit is contained in:
angelblue05 2015-12-24 16:16:58 -06:00
parent 163881e79f
commit 0e15daa37a
2 changed files with 8 additions and 5 deletions

View file

@ -94,6 +94,7 @@ def doMainListing():
def addUser(): def addUser():
doUtils = downloadutils.DownloadUtils() doUtils = downloadutils.DownloadUtils()
art = artwork.Artwork()
clientInfo = clientinfo.ClientInfo() clientInfo = clientinfo.ClientInfo()
deviceId = clientInfo.getDeviceId() deviceId = clientInfo.getDeviceId()
deviceName = clientInfo.getDeviceName() deviceName = clientInfo.getDeviceName()
@ -195,18 +196,19 @@ def addUser():
for i in range(totalNodes): for i in range(totalNodes):
if not utils.window('EmbyAdditionalUserImage.%s' % i): if not utils.window('EmbyAdditionalUserImage.%s' % i):
break break
utils.window('EmbyAdditionalUserImage.%s' % i) utils.window('EmbyAdditionalUserImage.%s' % i, clear=True)
url = "{server}/emby/Sessions?DeviceId=%s" % deviceId url = "{server}/emby/Sessions?DeviceId=%s" % deviceId
result = doUtils.downloadUrl(url) result = doUtils.downloadUrl(url)
additionalUsers = result[0]['AdditionalUsers'] additionalUsers = result[0]['AdditionalUsers']
count = 0 count = 0
for additionaluser in additionalUsers: 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) result = doUtils.downloadUrl(url)
utils.window('EmbyAdditionalUserImage.%s' % count, utils.window('EmbyAdditionalUserImage.%s' % count,
value=artwork.Artwork().getUserArtwork(result, 'Primary')) value=art.getUserArtwork(result['Id'], 'Primary'))
utils.window('EmbyAdditionalUserPosition.%s' % additionaluser['UserId'], value=str(count)) utils.window('EmbyAdditionalUserPosition.%s' % userid, value=str(count))
count +=1 count +=1
##### THEME MUSIC/VIDEOS ##### ##### THEME MUSIC/VIDEOS #####

View file

@ -188,13 +188,14 @@ class UserClient(threading.Thread):
def setUserPref(self): def setUserPref(self):
doUtils = self.doUtils doUtils = self.doUtils
art = artwork.Artwork()
url = "{server}/emby/Users/{UserId}?format=json" url = "{server}/emby/Users/{UserId}?format=json"
result = doUtils.downloadUrl(url) result = doUtils.downloadUrl(url)
self.userSettings = result self.userSettings = result
# Set user image for skin display # Set user image for skin display
if result.get('PrimaryImageTag'): 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 # Set resume point max
url = "{server}/emby/System/Configuration?format=json" url = "{server}/emby/System/Configuration?format=json"