VideoLibrary.GetMovies filter?
#1
Hi,

I'm new to all this so sorry if its a dumb question but how do you use the filter on VideoLibrary.GetMovies? an example would be great

Thanks
Reply
#2
Hi,

i've you tried this :
Code:
"filter" : ["year" : "2010", "tag" : "MyTag"]

As i understand, "filter" is an array with specific parameters as 'year' or 'tag'.

To see all parameters : Wiki, and expand JSON Schema Description
Reply
#3
Thanks

So you cant just filter by name? I need to create tags and filter by those?
Reply
#4
Apparently you can't filter by title. It would be great by the way : VideoLibrary.GetMovies 'StarWars'

Tags may be a solution to categorize/organize your movies, and then use it as filter.

If you want to retreive a single movie, only knowing his title, you may have to do it in two times.
  1. First retrieve all movies (VideoLibrary.GetMovies)
  2. search in that list the movie's title to get the movieid you search
  3. and then get detail information (VideoLibrary.GetMovieDetails)

I've not deeply searched it, so i may be mistaken.

After all i'm maybe as new as you are, i'm just a developper trying to help.
Reply
#5
You can use advanced filtering in VideoLibrary.GetMovies but it's a bit complicated. IIRC there are a few example requests floating around in the JSON-RPC part of the forum.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#6
(2013-08-27, 13:25)MokuJinJin Wrote: Apparently you can't filter by title. It would be great by the way : VideoLibrary.GetMovies 'StarWars'

Actually you can:

Code:
{"jsonrpc": "2.0", "params": {"sort": {"order": "ascending", "method": "title"}, "filter": {"operator": "contains", "field": "title", "value": "Star Wars"}, "properties": ["title", "art", "file"]}, "method": "VideoLibrary.GetMovies", "id": "libMovies"}

And an example combining two filters to find only Star Wars movies IV through VI (substitute a tag of "EmbarassinglyAwful" to find I through III):

Code:
{"jsonrpc": "2.0", "params": {"sort": {"order": "ascending", "method": "title"}, "filter": {"and": [{"operator": "contains", "field": "title", "value": "Star Wars"}, {"operator": "contains", "field": "tag", "value": "Good"}]}, "properties": ["title", "art"]}, "method": "VideoLibrary.GetMovies", "id": "libTags"}
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#7
Shocked 
There is no documentation of this 'wonderfull' filter Blush

thank you very much for this well illustrated exemple MilhouseVH.
Reply
#8
(2013-08-28, 01:17)MokuJinJin Wrote: There is no documentation of this 'wonderfull' filter Blush

thank you very much for this well illustrated exemple MilhouseVH.

I 2nd that, This is exactly what I wanted Many Thanks Big Grin
Reply
#9
Big Grin 
Yes. Very helpful. Thanks!
Image
VoxCommando.com
Reply
#10
(2013-08-27, 22:46)Milhouse Wrote: Actually you can:

Code:
{"jsonrpc": "2.0", "params": {"sort": {"order": "ascending", "method": "title"}, "filter": {"operator": "contains", "field": "title", "value": "Star Wars"}, "properties": ["title", "art", "file"]}, "method": "VideoLibrary.GetMovies", "id": "libMovies"}

And an example combining two filters to find only Star Wars movies IV through VI (substitute a tag of "EmbarassinglyAwful" to find I through III):

Code:
{"jsonrpc": "2.0", "params": {"sort": {"order": "ascending", "method": "title"}, "filter": {"and": [{"operator": "contains", "field": "title", "value": "Star Wars"}, {"operator": "contains", "field": "tag", "value": "Good"}]}, "properties": ["title", "art"]}, "method": "VideoLibrary.GetMovies", "id": "libTags"}


I need a little newbie help on the above.... I want to create a web page where I click on a button to filter my movie titles by the first letter of the title (excluding articles). I would have a button for all the letters in alphabet..... I need help on the filter section for what the operator and values are.

"filter": {"operator": "contains", "field": "title", "value": "S or s"}

Many thanks,

H.
Image
Reply
#11
The filter isn't case-sensitive so "value": "S" will suffice and find titles starting with both uppercase and lowercase S.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#12
(2015-01-05, 22:14)Milhouse Wrote: The filter isn't case-sensitive so "value": "S" will suffice and find titles starting with both uppercase and lowercase S.

Thank you Millhouse. So far I have the following working....

Code:
/jsonrpc?request={"jsonrpc": "2.0", "params": {"sort": {"order": "ascending", "method": "title", "ignorearticle": true}, "filter":{"operator": "startswith", "field": "title", "value": "f"}, "properties": ["title", "thumbnail", "imdbnumber", "year", "plot", "rating"]}, "method": "VideoLibrary.GetMovies", "id": "libMovies"}

It is filtering for fovies starting with the letter "f". But If I have a movie called "The Fall", it will NOT show up on my results. In essence the ignorearticle thing is not really doing anything. Is there a way to have the filter display The Fall movie?

Thank you for your help!!

H.
Image
Reply
#13
(2015-01-06, 00:29)hernandito Wrote: Thank you Millhouse. So far I have the following working....

Code:
/jsonrpc?request={"jsonrpc": "2.0", "params": {"sort": {"order": "ascending", "method": "title", "ignorearticle": true}, "filter":{"operator": "startswith", "field": "title", "value": "f"}, "properties": ["title", "thumbnail", "imdbnumber", "year", "plot", "rating"]}, "method": "VideoLibrary.GetMovies", "id": "libMovies"}

It is filtering for fovies starting with the letter "f". But If I have a movie called "The Fall", it will NOT show up on my results. In essence the ignorearticle thing is not really doing anything. Is there a way to have the filter display The Fall movie?

Thank you for your help!!

H.

I don't think that's possible. "ignorearticle" is a property of the sort, not the filter.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#14
(2015-01-06, 00:40)Milhouse Wrote: I don't think that's possible. "ignorearticle" is a property of the sort, not the filter.

Thank you Millhouse. I really appreciate your help.

I think I am able to do this by following your example above using combined "OR" operations like:

Code:
jsonrpc?request={"jsonrpc": "2.0", "params": {"filter": {"or": [{"operator": "startswith", "field": "title", "value": "f"}, {"operator": "startswith", "field": "title", "value": "The f"}]}, "sort": {"order": "ascending", "method": "title", "ignorearticle": true}, "properties": ["title", "thumbnail", "imdbnumber", "year", "plot", "rating"]}, "method": "VideoLibrary.GetMovies", "id": "libMovies"}

Can you anticipate any issues with this? I would never have figured this out without your reply to the original post.

Thanks again,

H.
Image
Reply
#15
(2015-01-06, 03:54)hernandito Wrote: Can you anticipate any issues with this? I would never have figured this out without your reply to the original post.

Only that it is a very language specific solution, ie, works only for languages such as English where "The" is only article, which is totally fine if this is only for personal use.

You can view what is considered to be an article in each language by viewing the langinfo.xml file and searching for "<tokens>". Most languages either have no article or only "The", but some languages, ie. Spanish, have several variations (The, El, Los, La, Las, Un), while Belarusian/Russian/Ukranian have 18 variations! This would make your solution more or less impractical for these languages. But for languages with only "The", it's fine.

Definite article (<token>) counts by language:
Code:
18 Belarusian
18 Russian
18 Ukrainian
10 Italian
9 Catalan
7 French
7 French (Canada)
6 Spanish
6 Spanish (Argentina)
5 Portuguese
5 Spanish (Mexico)
4 Dutch
4 German
4 Slovenian
3 Hungarian
1 Burmese
1 Czech
1 Danish
1 English
1 English (Australia)
1 English (New Zealand)
1 English (US)
1 Estonian
1 Faroese
1 Finnish
1 Icelandic
1 Japanese
1 Latvian
1 Maori
1 Norwegian
1 Romanian
1 Swedish
1 Thai
1 Welsh
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply

Logout Mark Read Team Forum Stats Members Help
VideoLibrary.GetMovies filter?0