2015-08-26, 15:15
(2015-08-26, 13:54)marcelveldt Wrote:(2015-08-26, 11:59)im85288 Wrote: 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.
Thanks. I just fixed it on Git. Could you give it a try ?
Just tried it and it's almost there, the only thing missing is to remove the "cast" attribute from the call to get the sets information else that call fails silently.
Code:
elif movieset and itemId:
json_query_string = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovieSetDetails", "params": { "setid": %d, "properties": [ "title"] }, "id": "1"}' %itemId)
json_result = json.loads(json_query_string.decode('utf-8','replace'))
if json_result.has_key('result') and json_result['result'].has_key('setdetails'):
movieset = json_result['result']['setdetails']
if movieset.has_key("movies"):
moviesetmovies = movieset['movies']
elif movieset and not itemId:
json_query_string = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovieSets", "params": { "filter": {"operator":"is", "field":"title", "value":"%s"}, "properties": [ "title" ] }, "id": "1"}' %tvshow)
json_result = json.loads(json_query_string.decode('utf-8','replace'))
if json_result.has_key('result') and json_result['result'].has_key('sets '):
movieset = json_result['result']['sets '][0]
if movieset.has_key("movies"):
moviesetmovies = movieset['movies']