mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Fix user image
This commit is contained in:
parent
163881e79f
commit
0e15daa37a
2 changed files with 8 additions and 5 deletions
|
@ -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 #####
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue