Kodi Community Forum

Full Version: Got an issue with filter on GetMovies
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I've trying to filer my movie listing by genreid but i'm getting this JSON returned:

Code:
{"error":{"code":-32602,"data":{"method":"VideoLibrary.GetMovies","stack":{"message":"Received value does not match any of the union type definitions","name":"filter","property":{"name":"order","type":"string"},"type":"object"}},"message":"Invalid params."},"id":1,"jsonrpc":"2.0"}

The JSON I'm posting looks like this:
Code:
{"jsonrpc":"2.0","method":"VideoLibrary.GetMovies","params":{"limits":{"start":0,"end":20},"filter":{"field":"genreid","operator":"is","value":1},"properties":["art","rating","genre","imdbnumber","plot","file","showlink","tag","trailer","year","streamdetails"],"sort":{"order":"descending","method":"dateadded","ignorearticle":true}},"id":1}

I've looked through so many KODI pages to try work out what i'm doing wrong, but I can't seem to work it out, I'm sure it's something simple if someone could help me out that would be great
There's something wrong with the error message. The
Code:
"property":{"name":"order","type":"string"
is wrong. But the request is wrong as well.

Either you need to specify the filter as
Code:
"filter": { "genreid": 1 }
(which can't be combined with other filters) or you need to use the genre name instead of its ID i.e.
Code:
"filter": { "field": "genreid", "operator": "is", "value": 1 }
Thanks for your help I was very confused by the error.

I'll do the first example you suggested and report back