2015-03-17 17:51:45 +00:00
|
|
|
#################################################################################################
|
|
|
|
# ReadEmbyDB
|
|
|
|
#################################################################################################
|
|
|
|
|
|
|
|
import xbmc
|
|
|
|
import xbmcgui
|
|
|
|
import xbmcaddon
|
|
|
|
|
2015-05-01 11:30:21 +00:00
|
|
|
|
|
|
|
|
2015-03-17 17:51:45 +00:00
|
|
|
from DownloadUtils import DownloadUtils
|
|
|
|
|
2015-03-25 17:37:21 +00:00
|
|
|
addon = xbmcaddon.Addon(id='plugin.video.emby')
|
2015-03-17 17:51:45 +00:00
|
|
|
|
|
|
|
class ReadEmbyDB():
|
2015-04-21 23:12:09 +00:00
|
|
|
|
2015-05-02 09:56:31 +00:00
|
|
|
def getMovies(self, id, itemList = []):
|
2015-03-17 17:51:45 +00:00
|
|
|
|
2015-06-12 08:02:11 +00:00
|
|
|
result = []
|
2015-04-21 23:12:09 +00:00
|
|
|
doUtils = DownloadUtils()
|
2015-05-01 11:30:21 +00:00
|
|
|
|
|
|
|
#only get basic info for our sync-compares
|
|
|
|
sortstring = "&SortBy=SortName"
|
2015-05-02 21:14:04 +00:00
|
|
|
url = "{server}/mediabrowser/Users/{UserId}/items?ParentId=%s%s&Fields=CumulativeRunTimeTicks,Etag&Recursive=true&SortOrder=Descending&IncludeItemTypes=Movie&CollapseBoxSetItems=false&format=json&ImageTypeLimit=1" % (id, sortstring)
|
2015-04-21 23:12:09 +00:00
|
|
|
|
|
|
|
jsonData = doUtils.downloadUrl(url)
|
|
|
|
if (jsonData == ""):
|
|
|
|
return result
|
2015-04-03 02:12:09 +00:00
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
if (jsonData[u'Items'] != ""):
|
|
|
|
result = jsonData[u'Items']
|
2015-04-03 08:38:51 +00:00
|
|
|
|
2015-05-02 09:56:31 +00:00
|
|
|
# Work around to only return items from the given list
|
|
|
|
if (result != None and len(result) > 0 and len(itemList) > 0):
|
|
|
|
newResult = []
|
|
|
|
for item in result:
|
|
|
|
if (item[u'Id'] in itemList):
|
|
|
|
newResult.append(item)
|
|
|
|
result = newResult
|
|
|
|
|
2015-03-17 17:51:45 +00:00
|
|
|
return result
|
2015-03-21 13:31:30 +00:00
|
|
|
|
2015-05-02 20:02:06 +00:00
|
|
|
def getMusicVideos(self, itemList = []):
|
2015-03-21 13:31:30 +00:00
|
|
|
|
2015-06-12 08:02:11 +00:00
|
|
|
result = []
|
2015-04-21 23:12:09 +00:00
|
|
|
doUtils = DownloadUtils()
|
2015-03-21 13:31:30 +00:00
|
|
|
|
2015-05-02 09:56:31 +00:00
|
|
|
#only get basic info for our sync-compares
|
|
|
|
sortstring = "&SortBy=SortName"
|
2015-05-02 21:14:04 +00:00
|
|
|
url = "{server}/mediabrowser/Users/{UserId}/items?%s&Fields=CumulativeRunTimeTicks,Etag&Recursive=true&SortOrder=Descending&IncludeItemTypes=MusicVideo&CollapseBoxSetItems=false&format=json&ImageTypeLimit=1" % sortstring
|
2015-03-21 13:31:30 +00:00
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
jsonData = doUtils.downloadUrl(url)
|
|
|
|
if (jsonData == ""):
|
|
|
|
return result
|
|
|
|
|
|
|
|
if (jsonData[u'Items'] != ""):
|
|
|
|
result = jsonData[u'Items']
|
2015-05-02 09:56:31 +00:00
|
|
|
|
|
|
|
# Work around to only return items from the given list
|
|
|
|
if (result != None and len(result) > 0 and len(itemList) > 0):
|
|
|
|
newResult = []
|
|
|
|
for item in result:
|
|
|
|
if (item[u'Id'] in itemList):
|
|
|
|
newResult.append(item)
|
|
|
|
result = newResult
|
2015-03-21 13:31:30 +00:00
|
|
|
|
|
|
|
return result
|
2015-05-07 22:04:40 +00:00
|
|
|
|
|
|
|
def getMusicArtists(self, itemList = []):
|
|
|
|
|
2015-05-07 23:13:29 +00:00
|
|
|
result = []
|
2015-05-07 22:04:40 +00:00
|
|
|
doUtils = DownloadUtils()
|
|
|
|
|
|
|
|
#only get basic info for our sync-compares
|
2015-07-30 19:23:50 +00:00
|
|
|
url = "{server}/Artists?Recursive=true&Fields=Etag,Path,Genres,SortName,Studios,Writer,ProductionYear,Taglines,CommunityRating,OfficialRating,CumulativeRunTimeTicks,Metascore,AirTime,DateCreated,MediaStreams,People,Overview&UserId={UserId}&format=json"
|
2015-05-07 22:04:40 +00:00
|
|
|
|
|
|
|
jsonData = doUtils.downloadUrl(url)
|
|
|
|
if (jsonData == ""):
|
|
|
|
return result
|
|
|
|
|
|
|
|
if (jsonData[u'Items'] != ""):
|
|
|
|
result = jsonData[u'Items']
|
2015-05-07 23:13:29 +00:00
|
|
|
|
2015-05-07 22:04:40 +00:00
|
|
|
# Work around to only return items from the given list
|
|
|
|
if (result != None and len(result) > 0 and len(itemList) > 0):
|
|
|
|
newResult = []
|
|
|
|
for item in result:
|
|
|
|
if (item[u'Id'] in itemList):
|
|
|
|
newResult.append(item)
|
|
|
|
result = newResult
|
|
|
|
|
|
|
|
return result
|
|
|
|
|
|
|
|
def getMusicSongs(self, itemList = []):
|
|
|
|
|
2015-06-12 08:02:11 +00:00
|
|
|
result = []
|
2015-05-07 22:04:40 +00:00
|
|
|
doUtils = DownloadUtils()
|
|
|
|
|
|
|
|
#only get basic info for our sync-compares
|
2015-07-30 19:23:50 +00:00
|
|
|
url = "{server}/mediabrowser/Users/{UserId}/Items?Fields=Etag,Path,Genres,SortName,Studios,Writer,ProductionYear,Taglines,CommunityRating,OfficialRating,CumulativeRunTimeTicks,Metascore,AirTime,DateCreated,MediaStreams,People,Overview&Recursive=true&IncludeItemTypes=Audio&format=json"
|
2015-05-07 22:04:40 +00:00
|
|
|
|
|
|
|
jsonData = doUtils.downloadUrl(url)
|
|
|
|
if (jsonData == ""):
|
|
|
|
return result
|
|
|
|
|
|
|
|
if (jsonData[u'Items'] != ""):
|
|
|
|
result = jsonData[u'Items']
|
|
|
|
|
|
|
|
# Work around to only return items from the given list
|
|
|
|
if (result != None and len(result) > 0 and len(itemList) > 0):
|
|
|
|
newResult = []
|
|
|
|
for item in result:
|
|
|
|
if (item[u'Id'] in itemList):
|
|
|
|
newResult.append(item)
|
|
|
|
result = newResult
|
|
|
|
|
|
|
|
return result
|
|
|
|
|
|
|
|
def getMusicAlbums(self, itemList = []):
|
2015-03-21 13:31:30 +00:00
|
|
|
|
2015-06-12 08:02:11 +00:00
|
|
|
result = []
|
2015-05-07 22:04:40 +00:00
|
|
|
doUtils = DownloadUtils()
|
|
|
|
|
|
|
|
#only get basic info for our sync-compares
|
2015-07-30 19:23:50 +00:00
|
|
|
url = "{server}/mediabrowser/Users/{UserId}/Items?Fields=Etag,Path,Genres,SortName,Studios,Writer,ProductionYear,Taglines,CommunityRating,OfficialRating,CumulativeRunTimeTicks,Metascore,AirTime,DateCreated,MediaStreams,People,Overview&Recursive=true&IncludeItemTypes=MusicAlbum&format=json"
|
2015-05-07 22:04:40 +00:00
|
|
|
|
|
|
|
jsonData = doUtils.downloadUrl(url)
|
|
|
|
if (jsonData == ""):
|
|
|
|
return result
|
|
|
|
|
|
|
|
if (jsonData[u'Items'] != ""):
|
|
|
|
result = jsonData[u'Items']
|
|
|
|
|
2015-05-08 00:44:32 +00:00
|
|
|
#only return valid albums - which have artists
|
|
|
|
tempresult = []
|
|
|
|
for item in result:
|
|
|
|
if item["AlbumArtists"]:
|
|
|
|
tempresult.append(item)
|
|
|
|
|
|
|
|
result = tempresult
|
|
|
|
|
|
|
|
|
2015-05-07 22:04:40 +00:00
|
|
|
# Work around to only return items from the given list
|
|
|
|
if (result != None and len(result) > 0 and len(itemList) > 0):
|
|
|
|
newResult = []
|
|
|
|
for item in result:
|
|
|
|
if (item[u'Id'] in itemList):
|
|
|
|
newResult.append(item)
|
|
|
|
result = newResult
|
|
|
|
|
|
|
|
return result
|
2015-05-07 23:45:28 +00:00
|
|
|
|
2015-03-19 17:40:29 +00:00
|
|
|
def getItem(self, id):
|
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
result = None
|
|
|
|
doUtils = DownloadUtils()
|
2015-03-19 17:40:29 +00:00
|
|
|
|
2015-05-07 23:13:29 +00:00
|
|
|
url = "{server}/mediabrowser/Users/{UserId}/Items/%s?format=json&ImageTypeLimit=1&Fields=Etag" % id
|
2015-04-21 23:12:09 +00:00
|
|
|
|
|
|
|
jsonData = doUtils.downloadUrl(url)
|
|
|
|
if (jsonData != ""):
|
|
|
|
result = jsonData
|
2015-03-19 17:40:29 +00:00
|
|
|
|
|
|
|
return result
|
|
|
|
|
2015-03-25 14:00:08 +00:00
|
|
|
def getFullItem(self, id):
|
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
result = None
|
|
|
|
doUtils = DownloadUtils()
|
2015-03-25 14:00:08 +00:00
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
url = "{server}/mediabrowser/Users/{UserId}/Items/%s?format=json&Fields=Path,Genres,SortName,Studios,Writer,ProductionYear,Taglines,CommunityRating,OfficialRating,CumulativeRunTimeTicks,Metascore,AirTime,DateCreated,MediaStreams,People,Overview" % id
|
|
|
|
|
|
|
|
jsonData = doUtils.downloadUrl(url)
|
|
|
|
if (jsonData != ""):
|
|
|
|
result = jsonData
|
2015-03-25 14:00:08 +00:00
|
|
|
|
|
|
|
return result
|
|
|
|
|
2015-05-02 09:56:31 +00:00
|
|
|
def getTvShows(self, id, itemList = []):
|
2015-03-17 17:51:45 +00:00
|
|
|
|
2015-06-12 08:02:11 +00:00
|
|
|
result = []
|
2015-04-21 23:12:09 +00:00
|
|
|
doUtils = DownloadUtils()
|
2015-03-18 17:00:38 +00:00
|
|
|
|
2015-05-01 11:30:21 +00:00
|
|
|
#only get basic info for our sync-compares
|
|
|
|
sortstring = "&SortBy=SortName"
|
2015-05-02 21:14:04 +00:00
|
|
|
url = "{server}/mediabrowser/Users/{UserId}/Items?ParentId=%s%s&Fields=CumulativeRunTimeTicks,Etag&Recursive=true&SortOrder=Descending&IncludeItemTypes=Series&format=json&ImageTypeLimit=1" % (id, sortstring)
|
2015-03-17 17:51:45 +00:00
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
jsonData = doUtils.downloadUrl(url)
|
|
|
|
if (jsonData == ""):
|
|
|
|
return result
|
|
|
|
|
|
|
|
if (jsonData[u'Items'] != ""):
|
|
|
|
result = jsonData[u'Items']
|
2015-05-02 09:56:31 +00:00
|
|
|
|
|
|
|
# Work around to only return items from the given list
|
|
|
|
if (result != None and len(result) > 0 and len(itemList) > 0):
|
|
|
|
newResult = []
|
|
|
|
for item in result:
|
|
|
|
if (item[u'Id'] in itemList):
|
|
|
|
newResult.append(item)
|
|
|
|
result = newResult
|
2015-03-19 21:31:06 +00:00
|
|
|
|
|
|
|
return result
|
|
|
|
|
|
|
|
def getTVShowSeasons(self, tvShowId):
|
|
|
|
|
2015-06-12 08:02:11 +00:00
|
|
|
result = []
|
2015-04-21 23:12:09 +00:00
|
|
|
doUtils = DownloadUtils()
|
2015-03-19 21:31:06 +00:00
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
url = "{server}/Shows/%s/Seasons?UserId={UserId}&format=json&ImageTypeLimit=1" % tvShowId
|
2015-03-19 21:31:06 +00:00
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
jsonData = doUtils.downloadUrl(url)
|
|
|
|
if (jsonData == ""):
|
|
|
|
return result
|
|
|
|
|
|
|
|
if (jsonData[u'Items'] != ""):
|
|
|
|
result = jsonData[u'Items']
|
2015-03-17 17:51:45 +00:00
|
|
|
|
|
|
|
return result
|
2015-04-12 08:34:00 +00:00
|
|
|
|
2015-05-02 09:56:31 +00:00
|
|
|
def getEpisodes(self, showId, itemList = []):
|
2015-03-17 17:51:45 +00:00
|
|
|
|
2015-06-12 08:02:11 +00:00
|
|
|
result = []
|
2015-04-21 23:12:09 +00:00
|
|
|
doUtils = DownloadUtils()
|
2015-03-17 17:51:45 +00:00
|
|
|
|
2015-05-02 21:14:04 +00:00
|
|
|
url = "{server}/mediabrowser/Users/{UserId}/Items?ParentId=%s&IsVirtualUnaired=false&IsMissing=False&SortBy=SortName&Fields=Name,SortName,CumulativeRunTimeTicks,Etag&Recursive=true&SortOrder=Ascending&IncludeItemTypes=Episode&format=json&ImageTypeLimit=1" % showId
|
2015-03-17 17:51:45 +00:00
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
jsonData = doUtils.downloadUrl(url)
|
|
|
|
if (jsonData == ""):
|
|
|
|
return result
|
|
|
|
|
|
|
|
if (jsonData[u'Items'] != ""):
|
|
|
|
result = jsonData[u'Items']
|
2015-05-02 09:56:31 +00:00
|
|
|
|
|
|
|
# Work around to only return items from the given list
|
|
|
|
if (result != None and len(result) > 0 and len(itemList) > 0):
|
|
|
|
newResult = []
|
|
|
|
for item in result:
|
|
|
|
if (item[u'Id'] in itemList):
|
|
|
|
newResult.append(item)
|
|
|
|
result = newResult
|
2015-04-12 08:34:00 +00:00
|
|
|
|
2015-03-17 17:51:45 +00:00
|
|
|
return result
|
|
|
|
|
2015-04-03 02:12:09 +00:00
|
|
|
def getLatestEpisodes(self, fullinfo = False, itemList = []):
|
2015-03-18 17:00:38 +00:00
|
|
|
|
2015-06-12 08:02:11 +00:00
|
|
|
result = []
|
2015-04-21 23:12:09 +00:00
|
|
|
doUtils = DownloadUtils()
|
2015-03-18 17:00:38 +00:00
|
|
|
|
2015-04-03 02:12:09 +00:00
|
|
|
limitString = "Limit=20&SortBy=DateCreated&"
|
|
|
|
if(len(itemList) > 0): # if we want a certain list specify it
|
|
|
|
limitString = "Ids=" + ",".join(itemList) + "&"
|
|
|
|
|
2015-03-18 17:00:38 +00:00
|
|
|
if fullinfo:
|
2015-05-02 21:14:04 +00:00
|
|
|
url = "{server}/mediabrowser/Users/{UserId}/Items?%sIsVirtualUnaired=false&IsMissing=False&Fields=ParentId,Path,Genres,SortName,Studios,Writer,ProductionYear,Taglines,CommunityRating,OfficialRating,CumulativeRunTimeTicks,Metascore,AirTime,DateCreated,MediaStreams,People,Overview,Etag&Recursive=true&SortOrder=Descending&IncludeItemTypes=Episode&format=json&ImageTypeLimit=1" % limitString
|
2015-03-18 17:00:38 +00:00
|
|
|
else:
|
2015-05-02 21:14:04 +00:00
|
|
|
url = "{server}/mediabrowser/Users/{UserId}/Items?%sIsVirtualUnaired=false&IsMissing=False&Fields=ParentId,Name,SortName,CumulativeRunTimeTicks,Etag&Recursive=true&SortOrder=Descending&IncludeItemTypes=Episode&format=json&ImageTypeLimit=1" % limitString
|
2015-03-18 17:00:38 +00:00
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
jsonData = doUtils.downloadUrl(url)
|
|
|
|
if (jsonData == ""):
|
|
|
|
return result
|
|
|
|
|
|
|
|
if (jsonData[u'Items'] != ""):
|
|
|
|
result = jsonData[u'Items']
|
2015-04-12 08:34:00 +00:00
|
|
|
|
2015-03-18 17:00:38 +00:00
|
|
|
return result
|
|
|
|
|
2015-03-17 17:51:45 +00:00
|
|
|
def getCollections(self, type):
|
|
|
|
#Build a list of the user views
|
2015-04-22 02:31:16 +00:00
|
|
|
doUtils = DownloadUtils()
|
2015-03-22 21:22:03 +00:00
|
|
|
|
|
|
|
try:
|
2015-04-21 23:12:09 +00:00
|
|
|
url = "{server}/mediabrowser/Users/{UserId}/Items/Root?format=json"
|
2015-04-22 02:31:16 +00:00
|
|
|
result = doUtils.downloadUrl(url)
|
2015-03-22 21:22:03 +00:00
|
|
|
except Exception, msg:
|
2015-04-21 23:12:09 +00:00
|
|
|
error = "Can't connect: %s" % msg
|
|
|
|
xbmc.log(error)
|
2015-03-22 21:22:03 +00:00
|
|
|
return []
|
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
if (result == ""):
|
2015-03-22 21:22:03 +00:00
|
|
|
return []
|
2015-04-21 23:12:09 +00:00
|
|
|
|
|
|
|
parentid = result[u'Id']
|
2015-03-22 21:22:03 +00:00
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
url = "{server}/mediabrowser/Users/{UserId}/items?ParentId=%s&Sortby=SortName&format=json" % parentid
|
2015-04-22 02:31:16 +00:00
|
|
|
result = doUtils.downloadUrl(url)
|
2015-03-22 21:22:03 +00:00
|
|
|
collections=[]
|
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
if (result == ""):
|
2015-03-22 21:22:03 +00:00
|
|
|
return []
|
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
result = result[u'Items']
|
2015-03-22 21:22:03 +00:00
|
|
|
|
|
|
|
for item in result:
|
2015-04-21 23:12:09 +00:00
|
|
|
if (item[u'RecursiveItemCount'] != 0):
|
|
|
|
Name = item[u'Name']
|
2015-04-22 02:31:16 +00:00
|
|
|
if u'CollectionType' not in item:
|
2015-04-05 13:55:41 +00:00
|
|
|
itemtype = "movies" # User may not have declared the type
|
2015-04-22 02:31:16 +00:00
|
|
|
else:
|
|
|
|
itemtype = item[u'CollectionType']
|
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
if itemtype == type and Name != "Collections":
|
|
|
|
collections.append({'title': Name,
|
|
|
|
'type' : itemtype,
|
|
|
|
'id' : item[u'Id']})
|
2015-03-22 21:22:03 +00:00
|
|
|
return collections
|
|
|
|
|
|
|
|
def getViewCollections(self, type):
|
|
|
|
#Build a list of the user views
|
2015-04-21 23:12:09 +00:00
|
|
|
doUtils = DownloadUtils()
|
|
|
|
|
|
|
|
viewsUrl = "{server}/mediabrowser/Users/{UserId}/Views?format=json&ImageTypeLimit=1"
|
2015-05-03 15:39:30 +00:00
|
|
|
result = doUtils.downloadUrl(viewsUrl)
|
2015-03-18 02:45:15 +00:00
|
|
|
collections=[]
|
2015-03-17 17:51:45 +00:00
|
|
|
|
2015-05-03 15:39:30 +00:00
|
|
|
if (result == ""):
|
|
|
|
return []
|
|
|
|
|
|
|
|
result = result[u'Items']
|
2015-03-18 02:45:15 +00:00
|
|
|
|
2015-05-03 15:39:30 +00:00
|
|
|
for view in result:
|
|
|
|
if (view[u'Type'] == 'UserView'): # Need to grab the real main node
|
|
|
|
newViewsUrl = "{server}/mediabrowser/Users/{UserId}/items?ParentId=%s&SortBy=SortName&SortOrder=Ascending&format=json&ImageTypeLimit=1" % view[u'Id']
|
|
|
|
newViews = doUtils.downloadUrl(newViewsUrl)
|
|
|
|
if (result == ""):
|
|
|
|
return []
|
|
|
|
newViews = newViews[u'Items']
|
|
|
|
for newView in newViews:
|
|
|
|
# There are multiple nodes in here like 'Latest', 'NextUp' - below we grab the full node.
|
|
|
|
if newView[u'CollectionType'] != None:
|
|
|
|
if newView[u'CollectionType'] == "MovieMovies" or newView[u'CollectionType'] == "TvShowSeries":
|
|
|
|
view=newView
|
|
|
|
if (view[u'ChildCount'] != 0):
|
|
|
|
Name = view[u'Name']
|
|
|
|
|
|
|
|
total = str(view[u'ChildCount'])
|
|
|
|
try:
|
2015-05-03 14:42:37 +00:00
|
|
|
itemtype = view[u'CollectionType']
|
2015-05-03 15:39:30 +00:00
|
|
|
except:
|
|
|
|
itemtype = "movies"
|
|
|
|
if itemtype == "MovieMovies":
|
|
|
|
itemtype = "movies"
|
|
|
|
if itemtype == "TvShowSeries":
|
|
|
|
itemtype = "tvshows"
|
|
|
|
if itemtype == type:
|
|
|
|
collections.append( {'title' : Name,
|
|
|
|
'type' : type,
|
|
|
|
'id' : view[u'Id']})
|
2015-03-17 17:51:45 +00:00
|
|
|
return collections
|
2015-03-24 16:47:26 +00:00
|
|
|
|
|
|
|
def getBoxSets(self):
|
|
|
|
|
2015-06-12 08:02:11 +00:00
|
|
|
result = []
|
2015-04-21 23:12:09 +00:00
|
|
|
doUtils = DownloadUtils()
|
2015-03-24 16:47:26 +00:00
|
|
|
|
2015-05-02 21:14:04 +00:00
|
|
|
url = "{server}/mediabrowser/Users/{UserId}/Items?SortBy=SortName&IsVirtualUnaired=false&IsMissing=False&Fields=Name,SortName,CumulativeRunTimeTicks,Etag&Recursive=true&SortOrder=Ascending&IncludeItemTypes=BoxSet&format=json&ImageTypeLimit=1"
|
2015-03-24 16:47:26 +00:00
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
jsonData = doUtils.downloadUrl(url)
|
|
|
|
if (jsonData == ""):
|
|
|
|
return result
|
|
|
|
|
|
|
|
if (jsonData[u'Items'] != ""):
|
|
|
|
result = jsonData[u'Items']
|
|
|
|
|
2015-03-24 16:47:26 +00:00
|
|
|
return result
|
|
|
|
|
|
|
|
def getMoviesInBoxSet(self,boxsetId):
|
|
|
|
|
2015-06-12 08:02:11 +00:00
|
|
|
result = []
|
2015-04-21 23:12:09 +00:00
|
|
|
doUtils = DownloadUtils()
|
2015-03-24 16:47:26 +00:00
|
|
|
|
2015-05-02 21:14:04 +00:00
|
|
|
url = "{server}/mediabrowser/Users/{UserId}/Items?ParentId=%s&Fields=ItemCounts,Etag&format=json&ImageTypeLimit=1" % boxsetId
|
2015-03-24 16:47:26 +00:00
|
|
|
|
2015-04-21 23:12:09 +00:00
|
|
|
jsonData = doUtils.downloadUrl(url)
|
|
|
|
if (jsonData == ""):
|
|
|
|
return result
|
|
|
|
|
|
|
|
if (jsonData[u'Items'] != ""):
|
|
|
|
result = jsonData[u'Items']
|
|
|
|
|
2015-04-15 02:20:08 +00:00
|
|
|
return result
|