add poster artwork to episodes

This commit is contained in:
shaun 2015-04-06 09:11:39 +10:00
parent 73ac8c46ce
commit b9ebb81322

View file

@ -388,7 +388,7 @@ class WriteKodiDB():
# for Helix we use the whole time string, for kodi 15 we have to change to only the datestring # for Helix we use the whole time string, for kodi 15 we have to change to only the datestring
# see: http://forum.kodi.tv/showthread.php?tid=218743 # see: http://forum.kodi.tv/showthread.php?tid=218743
if KodiItem["firstaired"] != premieredate: if KodiItem["firstaired"] != premieredate:
self.updateProperty(KodiItem,"firstaired",firstaired,"episode") changes |= self.updateProperty(KodiItem,"firstaired",firstaired,"episode")
if MBitem.get("CriticRating") != None: if MBitem.get("CriticRating") != None:
changes |= self.updateProperty(KodiItem,"rating",int(MBitem.get("CriticRating"))/10,"episode") changes |= self.updateProperty(KodiItem,"rating",int(MBitem.get("CriticRating"))/10,"episode")
@ -405,8 +405,10 @@ class WriteKodiDB():
def getArtworkParam_Batched(self, KodiItem, MBitem, params): def getArtworkParam_Batched(self, KodiItem, MBitem, params):
'''
item_type=str(MBitem.get("Type")) item_type=str(MBitem.get("Type"))
'''
if item_type == "Series": if item_type == "Series":
id = KodiItem['tvshowid'] id = KodiItem['tvshowid']
jsoncommand = '{"jsonrpc": "2.0", "method": "VideoLibrary.SetTVShowDetails", "params": { "tvshowid": %i, "art": %s}, "id": 1 }' jsoncommand = '{"jsonrpc": "2.0", "method": "VideoLibrary.SetTVShowDetails", "params": { "tvshowid": %i, "art": %s}, "id": 1 }'
@ -426,12 +428,14 @@ class WriteKodiDB():
artwork = {} artwork = {}
artwork["poster"] = API().getArtwork(MBitem, "Primary") artwork["poster"] = API().getArtwork(MBitem, "Primary")
artwork["banner"] = API().getArtwork(MBitem, "Banner")
artwork["clearlogo"] = API().getArtwork(MBitem, "Logo") if(item_type != "Episode"):
artwork["clearart"] = API().getArtwork(MBitem, "Art") artwork["banner"] = API().getArtwork(MBitem, "Banner")
artwork["landscape"] = API().getArtwork(MBitem, "Thumb") artwork["clearlogo"] = API().getArtwork(MBitem, "Logo")
artwork["discart"] = API().getArtwork(MBitem, "Disc") artwork["clearart"] = API().getArtwork(MBitem, "Art")
artwork["fanart"] = API().getArtwork(MBitem, "Backdrop") artwork["landscape"] = API().getArtwork(MBitem, "Thumb")
artwork["discart"] = API().getArtwork(MBitem, "Disc")
artwork["fanart"] = API().getArtwork(MBitem, "Backdrop")
for art in artwork: for art in artwork:
if artwork.get(art) != "": if artwork.get(art) != "":
@ -462,8 +466,8 @@ class WriteKodiDB():
id = KodiItem['tvshowid'] id = KodiItem['tvshowid']
jsoncommand = '{"jsonrpc": "2.0", "method": "VideoLibrary.SetTVShowDetails", "params": { "tvshowid": %i, "art": %s}, "id": 1 }' jsoncommand = '{"jsonrpc": "2.0", "method": "VideoLibrary.SetTVShowDetails", "params": { "tvshowid": %i, "art": %s}, "id": 1 }'
elif item_type == "Episode": elif item_type == "Episode":
# episodes don't have any artwork - they derrive this from the tv show id = KodiItem['episodeid']
return False jsoncommand = '{"jsonrpc": "2.0", "method": "VideoLibrary.SetEpisodeDetails", "params": { "episodeid": %i, "art": %s}, "id": 1 }'
elif item_type == "MusicVideo": elif item_type == "MusicVideo":
id = KodiItem['musicvideoid'] id = KodiItem['musicvideoid']
jsoncommand = '{"jsonrpc": "2.0", "method": "VideoLibrary.SetMusicVideoDetails", "params": { musicvideoid": %i, "art": %s}, "id": 1 }' jsoncommand = '{"jsonrpc": "2.0", "method": "VideoLibrary.SetMusicVideoDetails", "params": { musicvideoid": %i, "art": %s}, "id": 1 }'
@ -476,12 +480,14 @@ class WriteKodiDB():
artwork = {} artwork = {}
artwork["poster"] = API().getArtwork(MBitem, "Primary") artwork["poster"] = API().getArtwork(MBitem, "Primary")
artwork["banner"] = API().getArtwork(MBitem, "Banner")
artwork["clearlogo"] = API().getArtwork(MBitem, "Logo") if(item_type != "Episode"):
artwork["clearart"] = API().getArtwork(MBitem, "Art") artwork["banner"] = API().getArtwork(MBitem, "Banner")
artwork["landscape"] = API().getArtwork(MBitem, "Thumb") artwork["clearlogo"] = API().getArtwork(MBitem, "Logo")
artwork["discart"] = API().getArtwork(MBitem, "Disc") artwork["clearart"] = API().getArtwork(MBitem, "Art")
artwork["fanart"] = API().getArtwork(MBitem, "Backdrop") artwork["landscape"] = API().getArtwork(MBitem, "Thumb")
artwork["discart"] = API().getArtwork(MBitem, "Disc")
artwork["fanart"] = API().getArtwork(MBitem, "Backdrop")
for art in artwork: for art in artwork:
if artwork.get(art) != "": if artwork.get(art) != "":