2024-02-03, 07:47
(2024-02-02, 14:19)Hitcher Wrote: I can't get the correct cast list for the new 'Mr. & Mrs. Smith (2024)' TV show; I just get the cast for 'Mr And Mrs North (1952)' instead.
plugin://plugin.video.themoviedb.helper?info=cast&tmdb_type=tv&aggregate=true&query=$INFO[ListItem.TVShowTitle]&nextpage=false
It's the ampersand. You're effectively providing the URI paramstring as:
Code:
?info=cast&tmdb_type=tv&aggregate=true&query=Mr. & Mrs. Smith&nextpage=false
Which urllib will read as:
json:
{
"info": "cast",
"tmdb_type": "tv",
"aggregate": "true",
"query": "Mr. ",
"Mrs. Smith": "",
"nextpage": "false"
}
To use a special character & ? = , : / in a paramstring you need to percent encode it. Kodi's skinning engine doesn't have a method to do that, so you're effectively stuck.
You could use SkinVariables to first percent encode the query before appending to the URI but it feels like quite a roundabout way to get there:
https://github.com/jurialmunkey/script.s...-container
If you have any way to get the TV show ID (either tmdb_id imdb_id or tvdb_id) then you will get much better (i.e. exact) results rather than using a query search.
e.g. if you use the service monitor, can get the TMDb ID with $INFO[Container(99950).ListItem.Property(TMDb_ID)] to use in path like so:
Code:
?info=cast&tmdb_type=tv&aggregate=true&nextpage=false&tmdb_id=$INFO[Container(99950).ListItem.Property(TMDb_ID)]
Then all you need to do is check that ID is filled before showing your cast widget. The service will do a much more effective lookup of the item because it can handle all these special cases. Plus it is more efficient if you use multiple related lists as you only do the query lookup once (in the service) rather than for every individual list.