Kodi Community Forum

Full Version: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Just for the note, content doesn't have to be set on the folder, once a video from that folder is watched (playcount is added to database for that file) that call queries "watched" files anyway and slows the expected result.
I'll have to check the code later but a possibility would be to not check the database if the jsonrpc request does not contain any values in the "fields" array.
wsnipex Wrote:ahh, I see. thanks for the clarification.
is there way to send a GUI notification via json-rpc?

Not yet but it is planned.
Hey all,

(Hopefully this is the right place to put this)

I was trying to create an "audio output" switch for my remote, and currently I got it working using the SetGuiSettings method in the HTTP API. As the HTTP API is deprecated, I started looking for a similar operation in the JSON API, but could not find one. Is there such a method in the JSON API? If not, I would really much like to see this added as it adds a whole lot of options for scripting such as this.

-NRG
There is no such method yet but there will be in the future. The problem is that we would prefer it if we could check the name and the validity of the setting to be changed so that 3rd party applications cannot mess up the configuration of XBMC users.
OK, that's great to hear. Of course validation is always nice to have, so it's probably a good way to go. As long as the "future" comes before the final HTTP API removal, I'm all happy then Smile

Thanks for the reply.
-NRG
Hi Guys,

New to this but I have XBMC on my laptop (windows XP) and have been testing JSON RPC commands using a TPC connection to port 9090 with Hercules. I have had success with most commands I have tested but can't get any of the "Input" commands to work.

Command e.g.
Code:
{"jsonrpc":"2.0","id": 3,"method":"Input.Home"}

Response
Code:
{
   "error" : {
      "code" : -32601,
      "message" : "Method not found."
   },
   "id" : 3,
   "jsonrpc" : "2.0"
}


Am I doing something wrong?


Cheers
Jason
jasonvp Wrote:Am I doing something wrong?

What version of XBMC are you using? Looks like you are either using the latest stable Dharma release or a very old pre-eden nightly build. The Input methods have been added a few weeks ago and are therefore only available in latest pre-eden nightly builds.
Thanks for replying.

I am using 10.1 Dharma found here.

I'll try the latest build.


Cheers
Jason
Working now.

Thanks again.
Is there a way to get all possible elements of VideoLibrary.Fields.TVShow? They are not in the wiki.
Romep Wrote:Is there a way to get all possible elements of VideoLibrary.Fields.TVShow? They are not in the wiki.

Yes they are defined in the response from JSONRPC.Introspect. You can even try
Code:
{ "jsonrpc": "2.0", "method": "JSONRPC.Introspect", "params": { "filter": { "id": "VideoLibrary.Fields.TVShow", "type": "type" } }, "id": 1 }
and you should get the schema specification for VideoLibrary.Fields.TVShow only.
Oh, i didn't see them. Several remotes offer a banner list of all tv shows. Thumbnail and fanart are too large for a banner. Do i have to get them manually or were they just not downloaded by my scraper?
Can someone please give me an example of the parameters needed for "AudioLibrary.GetAlbumDetails" and "AudioLibrary.GetAlbums
"?

How do you know what the "Library.Id" is?

I have looked at the Introspect but I am struggling with it. Any help would great.


Cheers
Jason
"Library.Id" is a custom type that is defined in the json schema returned by JSONRPC.Introspect as well. What you can do is execute
Code:
{ "jsonrpc": "2.0", "method": "JSONRPC.Introspect", "params": { "filter": { "id": "Library.Id", "type": "type" } }, "id": 1 }
and you will only get the definition of "Library.Id". Basically "Library.Id" is a positive integer.

AudioLibrary.GetAlbums does not require any parameters but it can take the ID of an artist (retrieved through AudioLibrary.GetArtists) to only list the albums of a specific artist. AudioLibrary.GetAlbumDetails requires the ID of a specific album as a parameter.