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 - Zernable - 2013-02-13

Just when I thought I was getting a good grasp on the JSON syntax I'm getting an error that I can't figure out why. I'm trying to update several movie parameters at once. It seems as though if I do the movieid and one other parameter, it's successful, but if I add one (or more) additional parameters, then I get an error such as the one below. I'm sure it's something simple, but I haven't been able to figure out what I'm doing wrong.

What I'm trying:
Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.SetMovieDetails", "params": {"movieid": 130, "Movietitle": "Moviename", "plot": "this is where the plot goes"}, "id": 1}

Error in return:
Code:
{"error":{"code":-32602,"data":{"message":"Too many parameters","method":"VideoLibrary.SetMovieDetails","stack":{"name":"plot","type":["null","string"]}},"message":"Invalid params."},"id":1,"jsonrpc":"2.0"}



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - N3MIS15 - 2013-02-13

"Movietitle" should just be "title"


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Zernable - 2013-02-13

Ugh.. you know how many times I looked at the API details for that on the wiki page and I *never* noticed that. Sure enough, it's spelled out as plain as can be "[ Optional.String title = null ]". Thanks N3MIS15!


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2013-02-23

Just discover a strange limitation in Player.PlayPause.

If you force play while in fastforwarding or rewinding then the player does not change to play but keeps it's current state.
This behavior is quite different from gui or eventserver.

https://github.com/xbmc/xbmc/pull/2301 Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - dwagner - 2013-02-26

Is there a way to get lastmodifieddate from List.Item.File in a specific format, or alternatively is there a way to query the International Region setting?

Otherwise there is no way to really tell whether a date such as 01/02/13 is 2 Jan or 1 Feb


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2013-02-26

I was told that dates are in SQL format so YYYY-MM-DD HH:MM:SS no matter the local system settings.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - dwagner - 2013-02-26

My tests prove otherwise.

US 24 hour
"lastmodified":"01/24/2013 16:31:32"

UK 24 hour
"lastmodified":"24/01/2013 16:31:32"

UK 12 hour
"lastmodified":"24/01/2013 4:31:32 PM"


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-02-26

For some reason yet unknown to me "lastmodified" is provided in localized datetime representation whereas all other dates are provided in SQL format as stated by Tolriq. Will have to check if there's a reason for it or not.


Odp: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Marx1 - 2013-03-01

Is it possible to use scraper remotely?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-03-01

Currently not. There has been some initial work on this but that was quite a while ago and it needs to be adapted to the current state of the code.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Roman_V_M - 2013-03-01

Is it possible to get the full path to a currently played item via json-rpc? "Player.GetItem" returns only a library name/file name.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-03-01

(2013-03-01, 18:47)Roman_V_M Wrote: Is it possible to get the full path to a currently played item via json-rpc? "Player.GetItem" returns only a library name/file name.
The "file" property should provide you with the full path as used by XBMC. Obviously that might not be accessible on a remote computer if it's a local drive or something like that.

EDIT: Tested and works fine for me.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Marx1 - 2013-03-01

(2013-03-01, 18:46)Montellese Wrote: Currently not. There has been some initial work on this but that was quite a while ago and it needs to be adapted to the current state of the code.

Is it planned to merge it into stable, or it's only experiment? I think it would be beneficial for media managers authors, and users of those managers using foreign languages. Now media managers use mainly English websites, and authors need to write their owns scrapers, while scrapers already exists in xbmc ready for use.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Anthirian - 2013-03-02

Apologies if this has already been explained, but I couldn't find it by searching.

I am trying to perform filtering on multiple criteria using one RPC. Is this possible? I have tried stuffing both filters in a list
Code:
{"params": {"filter": [{"operator": "is", "field": "playcount", "value": "0"}, {"operator": "greaterthan", "field": "rating", "value": "2"}], "properties": ["rating", "playcount", "lastplayed", "file", "resume", "tvshowid"], "limits": {"end": 2}}, "jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "id": 1}
but that gives me the following error
Code:
{"error":{"code":-32602,"data":{"method":"VideoLibrary.GetEpisodes","stack":{"message":"Invalid type array received","name":"filter","property":{"name":"end","type":"integer"},"type":"object"}},"message":"Invalid params."},"id":1,"jsonrpc":"2.0"}

Any ideas?

Thanks in advance


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-03-03

(2013-03-01, 22:40)Marx1 Wrote: Is it planned to merge it into stable, or it's only experiment? I think it would be beneficial for media managers authors, and users of those managers using foreign languages. Now media managers use mainly English websites, and authors need to write their owns scrapers, while scrapers already exists in xbmc ready for use.
The work hasn't been done by me so I'm not really into it right now.

(2013-03-02, 14:49)Anthirian Wrote: Apologies if this has already been explained, but I couldn't find it by searching.

I am trying to perform filtering on multiple criteria using one RPC. Is this possible? I have tried stuffing both filters in a list
Code:
{"params": {"filter": [{"operator": "is", "field": "playcount", "value": "0"}, {"operator": "greaterthan", "field": "rating", "value": "2"}], "properties": ["rating", "playcount", "lastplayed", "file", "resume", "tvshowid"], "limits": {"end": 2}}, "jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "id": 1}
but that gives me the following error
Code:
{"error":{"code":-32602,"data":{"method":"VideoLibrary.GetEpisodes","stack":{"message":"Invalid type array received","name":"filter","property":{"name":"end","type":"integer"},"type":"object"}},"message":"Invalid params."},"id":1,"jsonrpc":"2.0"}

Any ideas?

Thanks in advance
You need to tell the "filter" how to combine your rules, either with "and" or with "or". An example with "and" would look like this:
Code:
{"params": {"filter": { "and": [{"operator": "is", "field": "playcount", "value": "0"}, {"operator": "greaterthan", "field": "rating", "value": "2"}] }, "properties": ["rating", "playcount", "lastplayed", "file", "resume", "tvshowid"], "limits": {"end": 2}}, "jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "id": 1}
The "filter" property has to be an object (and not an array) and it can either contain a single rule, or an "and" or "or" property which then is an array of rules or can again contain (nested) objects with "and" and "or" property. Yeah I know it can get very confusing.