Revert "Adjusted the rest to use the new method"

This reverts commit 0c91c0b28b.
This commit is contained in:
angelblue05 2015-04-21 21:20:02 -05:00
parent 0c91c0b28b
commit f8632a97d8
6 changed files with 282 additions and 154 deletions

View file

@ -182,11 +182,11 @@ class ReadEmbyDB():
def getCollections(self, type):
#Build a list of the user views
doUtils = DownloadUtils()
downloadUtils = DownloadUtils()
try:
url = "{server}/mediabrowser/Users/{UserId}/Items/Root?format=json"
result = doUtils.downloadUrl(url)
result = downloadUtils.downloadUrl(url)
except Exception, msg:
error = "Can't connect: %s" % msg
xbmc.log(error)
@ -198,7 +198,7 @@ class ReadEmbyDB():
parentid = result[u'Id']
url = "{server}/mediabrowser/Users/{UserId}/items?ParentId=%s&Sortby=SortName&format=json" % parentid
result = doUtils.downloadUrl(url)
result = downloadUtils.downloadUrl(url)
collections=[]
if (result == ""):
@ -209,11 +209,9 @@ class ReadEmbyDB():
for item in result:
if (item[u'RecursiveItemCount'] != 0):
Name = item[u'Name']
if u'CollectionType' not in item:
itemtype = item[u'CollectionType']
if itemtype == None or itemtype == "":
itemtype = "movies" # User may not have declared the type
else:
itemtype = item[u'CollectionType']
if itemtype == type and Name != "Collections":
collections.append({'title': Name,
'type' : itemtype,
@ -249,9 +247,9 @@ class ReadEmbyDB():
if type == None:
type = "None" # User may not have declared the type
if type == type:
collections.append( {'title' : Name,
'type' : type,
'id' : view[u'Id']})
collections.append({'title': Name,
'type' : type,
'id' : view[u'Id']})
return collections
def getBoxSets(self):