prevent errors on empty results

This commit is contained in:
Marcel van der Veldt 2015-06-12 10:02:11 +02:00
parent 2f78ea46d9
commit c71634d18c

View file

@ -16,7 +16,7 @@ class ReadEmbyDB():
def getMovies(self, id, itemList = []): def getMovies(self, id, itemList = []):
result = None result = []
doUtils = DownloadUtils() doUtils = DownloadUtils()
#only get basic info for our sync-compares #only get basic info for our sync-compares
@ -42,7 +42,7 @@ class ReadEmbyDB():
def getMusicVideos(self, itemList = []): def getMusicVideos(self, itemList = []):
result = None result = []
doUtils = DownloadUtils() doUtils = DownloadUtils()
#only get basic info for our sync-compares #only get basic info for our sync-compares
@ -93,7 +93,7 @@ class ReadEmbyDB():
def getMusicSongs(self, itemList = []): def getMusicSongs(self, itemList = []):
result = None result = []
doUtils = DownloadUtils() doUtils = DownloadUtils()
#only get basic info for our sync-compares #only get basic info for our sync-compares
@ -118,7 +118,7 @@ class ReadEmbyDB():
def getMusicAlbums(self, itemList = []): def getMusicAlbums(self, itemList = []):
result = None result = []
doUtils = DownloadUtils() doUtils = DownloadUtils()
#only get basic info for our sync-compares #only get basic info for our sync-compares
@ -178,7 +178,7 @@ class ReadEmbyDB():
def getTvShows(self, id, itemList = []): def getTvShows(self, id, itemList = []):
result = None result = []
doUtils = DownloadUtils() doUtils = DownloadUtils()
#only get basic info for our sync-compares #only get basic info for our sync-compares
@ -204,7 +204,7 @@ class ReadEmbyDB():
def getTVShowSeasons(self, tvShowId): def getTVShowSeasons(self, tvShowId):
result = None result = []
doUtils = DownloadUtils() doUtils = DownloadUtils()
url = "{server}/Shows/%s/Seasons?UserId={UserId}&format=json&ImageTypeLimit=1" % tvShowId url = "{server}/Shows/%s/Seasons?UserId={UserId}&format=json&ImageTypeLimit=1" % tvShowId
@ -220,7 +220,7 @@ class ReadEmbyDB():
def getEpisodes(self, showId, itemList = []): def getEpisodes(self, showId, itemList = []):
result = None result = []
doUtils = DownloadUtils() doUtils = DownloadUtils()
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 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
@ -244,7 +244,7 @@ class ReadEmbyDB():
def getLatestEpisodes(self, fullinfo = False, itemList = []): def getLatestEpisodes(self, fullinfo = False, itemList = []):
result = None result = []
doUtils = DownloadUtils() doUtils = DownloadUtils()
limitString = "Limit=20&SortBy=DateCreated&" limitString = "Limit=20&SortBy=DateCreated&"
@ -350,7 +350,7 @@ class ReadEmbyDB():
def getBoxSets(self): def getBoxSets(self):
result = None result = []
doUtils = DownloadUtils() doUtils = DownloadUtils()
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" 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"
@ -366,7 +366,7 @@ class ReadEmbyDB():
def getMoviesInBoxSet(self,boxsetId): def getMoviesInBoxSet(self,boxsetId):
result = None result = []
doUtils = DownloadUtils() doUtils = DownloadUtils()
url = "{server}/mediabrowser/Users/{UserId}/Items?ParentId=%s&Fields=ItemCounts,Etag&format=json&ImageTypeLimit=1" % boxsetId url = "{server}/mediabrowser/Users/{UserId}/Items?ParentId=%s&Fields=ItemCounts,Etag&format=json&ImageTypeLimit=1" % boxsetId