Kodi Community Forum
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174)
+---- Thread: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263)



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-08-20

(2012-08-20, 00:01)Tolriq Wrote: Not sure understand, those are configured in advanced settings and does not change.
I suppose you mean they can be activated or not in the views but the list containing (The, A , An, ...) should not change. And getting this list from remotes will allow remotes to reproduce Xbmc sorting if the user want it.

Ah I guess I misunderstood. I thought you wanted access to what sorting method is used for movies or tvshows etc but you want access to the list of articles to ignore during sorting? That's not accessible either right now.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2012-08-20

Yes it's not Sad If we can get it it would be cool Smile

With the get language of Xbmc we will be able to copy all data from Xbmc sources to get default sorttokens by languages but we miss those that the user may have added manually.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-08-20

I will not start adding access to specific advancedsettings or guisettings because that will result in a huge mess which in turn will result in a refactor that will break backwards compatibility. This will be available once there is a generic way to access advanced settings (and GUI settings) but I haven't looked into it yet.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2012-08-20

That makes sense Smile

Was just listing needs hope for Frodo Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - jmarshall - 2012-08-20

@Tolriq: What is your goal in accessing them? Surely they should be client-specific, rather than being something spat out over JSON-RPC ?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2012-08-20

Well it's a query I've get from a lot of my users to be able to sort items in Yatse the same way they are sorted in Xbmc interface. (For those who activate the ignore sort tokens).

For advanced users that use advancedsettings.xml that would permit a unique point of modification since they modify Xbmc to suit their need and the remote automatically adjust. (Normal behavior for a remote I believe).

For other users who use default values from langdata it would also allow auto configuration while they perhaps don't really know all the default values.

And currently there's no way to get the tokens or the sortitles with the tokens removed. There's perhaps a way to get them in the correct order via a parameter in Json query but this is not suitable for me, since I do database sync (with from Frodo differential update) and can sort by name + year, so the solutions I see are :

- add a Json option to fill sorttitle with sorttokens removed (but what to do for already set sorttitles where sorttokens may apply ....), or a new field.
- add a Json query to get those sorttokens.

Or at least a way to get current Xbmc language (that may be different than remote one) and let the remote maker have a copy of default langdata and let the user add / remote tokens from that default list.






RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-08-20

(2012-08-19, 23:51)Montellese Wrote:
(2012-08-16, 23:45)Mizaki Wrote: Am I right in saying there is no way to retrieve the resume point of a file? I use GetFooDetails for movies and TV but am I missing a way to do it when the file is played and not in the library?
Yup that's probably not possible. I'll have a look if I can add an extra call to retrieve that information if requested by the client.
I've just created a pull request which contains the following two changes: a new method Files.GetFileDetails and the possibility to retrieve resume point, lastplayed and playcount for video items that are not part of the video library (no special action required by the client apart from specifying "media": "video" as a parameter).

(2012-08-19, 23:51)Montellese Wrote:
(2012-08-19, 01:21)Mizaki Wrote: Sorry if I've missed something but can I not do a smart playlist type filter with a single item? For example:
Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "filter": { "field": "title", "operator": "startswith", "value": "A" } }, "id": 1}
Seems like I forgot about the case of a single filter where it is a bit of a pain to just define an "and" or an "or" property containing the actual rule. Will see that I can get it in. Thanks for the hint.
I've extended the PR with the possibility to specify a single filter rule directly in the "filter" object. Furthermore it is now also possible to use the extended filtering in AudioLibrary.GetArtists.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Martijn - 2012-08-20

@Montellese
Isn't the wiki updated yet with the filter method (or am i just blind)?

Is there also the possibility to filter on 'InProgress' (and some other we might need but can't recall atm) for use in Watchlist?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-08-20

(2012-08-20, 11:45)Martijn Wrote: @Montellese
Isn't the wiki updated yet with the filter method (or am i just blind)?
There's a problem with updating the wiki article on the JSON-RPC API. Whenever I try to update a part of it it errors out because it's too much data to handle. Need to find a solution for this with NedScott when I got some more time.

(2012-08-20, 11:45)Martijn Wrote: Is there also the possibility to filter on 'InProgress' (and some other we might need but can't recall atm) for use in Watchlist?

You'll be able to filter by "in progress" once the advanced filtering with XSP-based rules is available to JSON-RPC (will be merged in the next window). You will get all the filtering possibilities that XSP offers you and you can even do more sophisticated combinations of rules.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Martijn - 2012-08-20

(2012-08-20, 12:42)Montellese Wrote: You'll be able to filter by "in progress" once the advanced filtering with XSP-based rules is available to JSON-RPC (will be merged in the next window). You will get all the filtering possibilities that XSP offers you and you can even do more sophisticated combinations of rules.

Nice Big Grin
Will pull in your .patch to already start rewriting the scripts


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-08-20

Thanks for the quick turn around. First thing I've come across is a bit weird:
Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": { "filter": { "and": [ { "field": "year", "operator": "endswith", "value": "10" }, { "field": "label", "operator": "startswith", "value": "v" } ]  }, "properties" : ["year"] }, "id": 1}
returns:
Code:
{"id": 1,"jsonrpc": "2.0","result": {"limits": {"end": 1,"start": 0,"total": 1},"tvshows": ["label": "The X-Files","tvshowid": 2,"year": 1993}]}}
and if I do the year value as int I get all the TV shows. Now I realise "label" isn't actually a valid field name and it works as expect if I use the correct "title" field name and year as int but I still don't think it should do what it is Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2012-08-20

Is there a way to get .strm files in Files.GetDirectory with media set to video ?

It seems that they don't list even if the strm are scraped in Xbmc database.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-08-20

This one is more smart playlist related I think but it doesn't seem possible to ignore the article when filtering with title?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-08-20

(2012-08-20, 20:44)Mizaki Wrote: Thanks for the quick turn around. First thing I've come across is a bit weird:
Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": { "filter": { "and": [ { "field": "year", "operator": "endswith", "value": "10" }, { "field": "label", "operator": "startswith", "value": "v" } ]  }, "properties" : ["year"] }, "id": 1}
returns:
Code:
{"id": 1,"jsonrpc": "2.0","result": {"limits": {"end": 1,"start": 0,"total": 1},"tvshows": ["label": "The X-Files","tvshowid": 2,"year": 1993}]}}
and if I do the year value as int I get all the TV shows. Now I realise "label" isn't actually a valid field name and it works as expect if I use the correct "title" field name and year as int but I still don't think it should do what it is Smile
Yeah it's a bit of a problem that there is no automatic validation (or information in the JSON schema) about what data type each field expects and what operators are valid. You should actually get an error when trying to use the "label" field in VideoLibrary.GetTVShows. Furthermore as already mentioned "year" expects an integer and "endswith" does not work for integers but only for strings. But the result is still very odd. No clue what happens Undecided
I need to think about a way to get more automatic validation and information about these filtering rules.

(2012-08-20, 20:51)Tolriq Wrote: Is there a way to get .strm files in Files.GetDirectory with media set to video ?

It seems that they don't list even if the strm are scraped in Xbmc database.
.strm is in the list of video extensions so they should be listed by Files.GetDirectory when "media" is set to "video".



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-08-20

(2012-08-20, 21:06)Mizaki Wrote: This one is more smart playlist related I think but it doesn't seem possible to ignore the article when filtering with title?

Nope that's not even possible with smartplaylists in XBMC itself. You can only try a rule with the "contains" operator but then "car" will not only match "Cars" and "Cars 2" but also "Pirates of the Caribbean".