Add showtitle and episodeno to label2

for listitem
This commit is contained in:
angelblue05 2017-06-24 22:03:55 -05:00
parent 21e7a9cada
commit 4a3be4d628

View file

@ -818,6 +818,7 @@ def BrowseChannels(itemid, folderid=None):
def createListItem(item):
title = item['title']
label2 = ""
li = xbmcgui.ListItem(title)
li.setProperty('IsPlayable', "true")
@ -829,6 +830,10 @@ def createListItem(item):
'Playcount': item['playcount']
}
if "showtitle" in item:
metadata['TVshowTitle'] = item['showtitle']
label2 = item['showtitle']
if "episodeid" in item:
# Listitem of episode
metadata['mediatype'] = "episode"
@ -844,14 +849,13 @@ def createListItem(item):
metadata['Season'] = season
if season and episode:
li.setProperty('episodeno', "s%.2de%.2d" % (season, episode))
episodeno = "s%.2de%.2d" % (season, episode)
li.setProperty('episodeno', episodeno)
label2 = "%s - %s" % (label2, episodeno) if label2 else episodeno
if "firstaired" in item:
metadata['Premiered'] = item['firstaired']
if "showtitle" in item:
metadata['TVshowTitle'] = item['showtitle']
if "rating" in item:
metadata['Rating'] = str(round(float(item['rating']),1))
@ -871,6 +875,7 @@ def createListItem(item):
metadata['Cast'] = cast
metadata['CastAndRole'] = castandrole
li.setLabel2(label2)
li.setInfo(type="Video", infoLabels=metadata)
li.setProperty('resumetime', str(item['resume']['position']))
li.setProperty('totaltime', str(item['resume']['total']))