Catch error retrieving session

To review later
This commit is contained in:
angelblue05 2016-10-27 05:02:15 -05:00
parent 45378edbe8
commit 245b1ce9fa

View file

@ -364,9 +364,14 @@ def addUser():
break break
window('EmbyAdditionalUserImage.%s' % i, clear=True) window('EmbyAdditionalUserImage.%s' % i, clear=True)
url = "{server}/emby/Sessions?DeviceId=%s" % deviceId url = "{server}/emby/Sessions?DeviceId=%s&format=json" % deviceId
result = doUtils.downloadUrl(url) result = doUtils.downloadUrl(url)
additionalUsers = result[0]['AdditionalUsers'] try:
additionalUsers = result[0]['AdditionalUsers']
except (KeyError, TypeError) as error:
log.error(error)
additionaluser = []
count = 0 count = 0
for additionaluser in additionalUsers: for additionaluser in additionalUsers:
userid = additionaluser['UserId'] userid = additionaluser['UserId']