(2021-08-27, 15:22)abratchik Wrote: Any idea how the actor images can be added in the video addon? I'm able to specify the cast for a movie through the info tag but actor photos are not shown in the Info dialog, just names. Any particular API I need to use to populate the photo links?
I do it in a two step process. First create a cast dictionary list and then add the cast list dictionary to the listitem.
python:
actor_list = ''
cast_dict = [] # Added cast & thumbnail display from Mezzmo server
cast_dict_keys = ['name','thumbnail']
actors = item.find('.//{urnchemas-upnp-org:metadata-1-0/upnp/}artist')
if actors != None:
actor_list = actors.text.encode('utf-8', 'ignore').split(',')
for a in actor_list:
actorSearchUrl = imageSearchUrl + "?imagesearch=" + a.lstrip().replace(" ","+")
new_record = [ a.strip() , actorSearchUrl]
cast_dict.append(dict(zip(cast_dict_keys, new_record)))
info = {
'duration': getSeconds(duration_text),
'genre': genre_text,
'year': release_year_text,
'title': title,
'plot': description_text,
'director': creator_text,
'tagline': tagline_text,
'writer': writer_text,
'cast': artist_text.split(','),
'artist': artist_text.split(','),
'rating': rating_val,
'imdbnumber': imdb_text,
'mediatype': categories_text,
'season': season_text,
'episode': episode_text,
'lastplayed': last_played_text,
'aired': release_date_text,
'mpaa':content_rating_text,
'studio':production_company_text,
'playcount':playcount,
'trailer':trailerurl,
'tvshowtitle':album_text,
'dateadded':date_added_text,
}
li.setInfo(mediaClass_text, info)
Here's
a link using the setCast approach which is similar. Here's
the link to the newer InfoTagVideo
approach. I've not done any coding with it yet but I believe the same cast list dictionary works with it..
Note the utf-8 encode isn't needed for Kodi 19 and the cast append format changes to:
cast_dict.append(dict(list(zip(cast_dict_keys, new_record))))
Jeff