2015-08-26, 11:59
Hi Marcel,
The cast list for movie sets is not working, I took a look and can see it is having issues with trying to get the cast returned for each movie.
This code will solve it but only returns the cast for the last movie in the collection, I'm not sure what you wanted to return (ie combine the cast lists?) but here is the code if it helps.
The cast list for movie sets is not working, I took a look and can see it is having issues with trying to get the cast returned for each movie.
This code will solve it but only returns the cast for the last movie in the collection, I'm not sure what you wanted to return (ie combine the cast lists?) but here is the code if it helps.
Code:
elif movieset and itemId:
json_query_string = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovieSetDetails", "params": { "setid": %d, "properties": [ "title" ] }, "id": "1"}' %itemId)
castList = []
print json_query_string
json_result = json.loads(json_query_string.decode('utf-8','replace'))
print json_result
if json_result.has_key('result') and json_result['result'].has_key('setdetails'):
movieset = json_result['result']['setdetails']
if movieset.has_key("movies"):
for movie in movieset['movies']:
json_query_string = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovieDetails", "params": { "movieid": %d, "properties": [ "title", "cast" ] }, "id": "1"}' %movie["movieid"])
print json_query_string
json_result = json.loads(json_query_string.decode('utf-8','replace'))
if json_result.has_key('result') and json_result['result'].has_key('moviedetails'):
item = json_result['result']['moviedetails']
for cast in item["cast"]:
if not cast["name"] in castList:
liz = xbmcgui.ListItem(label=cast["name"],label2=cast["role"],iconImage=cast["thumbnail"])
liz.setProperty('IsPlayable', 'false')
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url="", listitem=liz, isFolder=True)
castList.append(cast["name"])