added season posters

This commit is contained in:
im85288 2015-03-19 21:31:06 +00:00
parent 34ea46b9cb
commit 4a1bd80093
2 changed files with 27 additions and 0 deletions

View file

@ -113,6 +113,12 @@ class CreateFiles():
SubElement(root, "tag").text = tag SubElement(root, "tag").text = tag
SubElement(root, "thumb").text = API().getArtwork(item, "Primary") SubElement(root, "thumb").text = API().getArtwork(item, "Primary")
if item_type == 'Series':
seasonData = ReadEmbyDB().getTVShowSeasons(item["Id"])
if seasonData != None:
for season in seasonData:
SubElement(root, "thumb",{"type":"season","season":str(season["IndexNumber"])}).text = API().getArtwork(season, "Primary")
SubElement(root, "fanart").text = API().getArtwork(item, "Backdrop") SubElement(root, "fanart").text = API().getArtwork(item, "Backdrop")

View file

@ -88,6 +88,27 @@ class ReadEmbyDB():
return result return result
def getTVShowSeasons(self, tvShowId):
result = None
addon = xbmcaddon.Addon(id='plugin.video.mb3sync')
port = addon.getSetting('port')
host = addon.getSetting('ipaddress')
server = host + ":" + port
downloadUtils = DownloadUtils()
userid = downloadUtils.getUserId()
url = 'http://' + server + '/Shows/' + tvShowId + '/Seasons?UserId=' + userid + '&format=json&ImageTypeLimit=1'
jsonData = downloadUtils.downloadUrl(url, suppress=True, popup=0)
if jsonData != None and jsonData != "":
result = json.loads(jsonData)
if(result.has_key('Items')):
result = result['Items']
return result
def getEpisodes(self, showId, fullinfo = False): def getEpisodes(self, showId, fullinfo = False):
result = None result = None