Skip to content

Commit

Permalink
Update tmdbinfo.py
Browse files Browse the repository at this point in the history
  • Loading branch information
anis3 authored Dec 14, 2020
1 parent fdf8535 commit 98929d1
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions resources/lib/tmdbinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,36 +58,38 @@ def onInit(self):
data = eval(str(meta['credits']))

listitems = []
for i in data['cast']:
slabel = i['name']
slabel2 = i['character']
if i['profile_path']:
sicon = self.poster + str(i['profile_path'])
else:
sicon = self.none_poster % slabel
sid = i['id']
listitem_ = xbmcgui.ListItem(label=slabel, label2=slabel2)
listitem_.setProperty('id', str(sid))
listitem_.setArt({'icon': sicon})
listitems.append(listitem_)
cast.append(slabel.encode('ascii', 'ignore'))
self.getControl(50).addItems(listitems)
if 'cast' in data and data['cast']:
for i in data['cast']:
slabel = i['name']
slabel2 = i['character']
if i['profile_path']:
sicon = self.poster + str(i['profile_path'])
else:
sicon = self.none_poster % slabel
sid = i['id']
listitem_ = xbmcgui.ListItem(label=slabel, label2=slabel2)
listitem_.setProperty('id', str(sid))
listitem_.setArt({'icon': sicon})
listitems.append(listitem_)
cast.append(slabel.encode('ascii', 'ignore'))
self.getControl(50).addItems(listitems)

listitems2 = []
for i in data['crew']:
slabel = i['name']
slabel2 = i['job']
if i['profile_path']:
sicon = self.poster + str(i['profile_path'])
else:
sicon = self.none_poster % slabel
sid = i['id']
listitem_ = xbmcgui.ListItem(label=slabel, label2=slabel2)
listitem_.setProperty('id', str(sid))
listitem_.setArt({'icon': sicon})
listitems2.append(listitem_)
crew.append(slabel.encode('ascii', 'ignore'))
self.getControl(5200).addItems(listitems2)
if 'crew' in data and data['crew']:
for i in data['crew']:
slabel = i['name']
slabel2 = i['job']
if i['profile_path']:
sicon = self.poster + str(i['profile_path'])
else:
sicon = self.none_poster % slabel
sid = i['id']
listitem_ = xbmcgui.ListItem(label=slabel, label2=slabel2)
listitem_.setProperty('id', str(sid))
listitem_.setArt({'icon': sicon})
listitems2.append(listitem_)
crew.append(slabel.encode('ascii', 'ignore'))
self.getControl(5200).addItems(listitems2)

meta['title'] = sTitle
if 'rating' not in meta or meta['rating'] == 0:
Expand Down

0 comments on commit 98929d1

Please sign in to comment.