2015-12-08, 22:25
*DOH* Wrong forum again *blush* sorry..please move at will.
Hi,
I need "this" to work to handle Albums, but I am having a hard time getting it to work.
I would like to get Albums that
1. span a certain time frame and
2. has similar genres; Eg. the genre string contains one or more of ["blues" "jazz", "swing"]
I made the filter below, expecting it to work, but it seems to ignore the "or" part IF the "and" part is present.
If I use just the "or" part, that part works as expected; returns only albums with certain genres.
I believe that the "and" part lists conditions that ALL have to be fulfilled, whereas the "or" part lists conditions where AT LEAST ONE have to be fulfilled.
Any help appreciated!
Is the query below supposed to work?
(I used http://jsonlint.com to validate (and format for this forum) the json, and http://kodi.wiki/view/JSON-RPC_API/v6#Li...ter.Albums as a guide (along with threads on the subject).
The entire query I use is:
p.s. This problem could easily be down to my bool logic failing... but I hope not
Hi,
I need "this" to work to handle Albums, but I am having a hard time getting it to work.
I would like to get Albums that
1. span a certain time frame and
2. has similar genres; Eg. the genre string contains one or more of ["blues" "jazz", "swing"]
I made the filter below, expecting it to work, but it seems to ignore the "or" part IF the "and" part is present.
If I use just the "or" part, that part works as expected; returns only albums with certain genres.
I believe that the "and" part lists conditions that ALL have to be fulfilled, whereas the "or" part lists conditions where AT LEAST ONE have to be fulfilled.
Any help appreciated!
Is the query below supposed to work?
Code:
{
"filter": {
"and": [{
"field": "year",
"operator": "greaterthan",
"value": "1969"
}, {
"field": "year",
"operator": "lessthan",
"value": "1980"
}],
"or": [{
"field": "genre",
"operator": "contains",
"value": "jazz"
}, {
"field": "genre",
"operator": "contains",
"value": "blues"
}, {
"field": "genre",
"operator": "contains",
"value": "swing"
}]
}
}
(I used http://jsonlint.com to validate (and format for this forum) the json, and http://kodi.wiki/view/JSON-RPC_API/v6#Li...ter.Albums as a guide (along with threads on the subject).
The entire query I use is:
Code:
"jsonrpc": "2.0", "method": "AudioLibrary.GetAlbums", "params": { "filter": {"and": [{"field": "year","operator": "greaterthan","value": "1969"}, {"field": "year","operator": "lessthan","value": "1980"}],"or": [{"field": "genre","operator": "contains","value": "jazz"}, {"field": "genre","operator": "contains","value": "blues"}, {"field": "genre","operator": "contains","value": "swing"}]}, "properties": ["genre", "artist", "title", "year", "thumbnail"], "sort": { "order": "ascending", "method": "artist", "ignorearticle": true }}, "id": "libAlbums"}
p.s. This problem could easily be down to my bool logic failing... but I hope not