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)



- Montellese - 2012-01-20

No you can only get all actors from a movie by adding "cast" to the "properties" parameter but that only works for pre-Eden and Eden Beta versions anyway. In Dharma this is not possible at all.


- __teoREtik__ - 2012-01-20

Montellese Wrote:No you can only get all actors from a movie by adding "cast" to the "properties" parameter but that only works for pre-Eden and Eden Beta versions anyway. In Dharma this is not possible at all.

Oh, I see know. Thank you for concrete explanationBig Grin


- Mizaki - 2012-01-21

I'm getting genreid 0 for all music genres. Is it broken or just me?
Code:
{"jsonrpc": "2.0", "method": "AudioLibrary.GetGenres", "id": 1}
Code:
{"id":1,"jsonrpc":"2.0","result":{"genres":[{"genreid":0,"label":"Unknown"},{"genreid":0,"label":"Other Punk"},{"genreid":0,"label":"Indie"},{"genreid":0,"label":"Pop/Rock"},{"genreid":0,"label":"Pop"},{"genreid":0,"label":"Rock"},



- Montellese - 2012-01-21

Thanks for the report. VideoLibrary.GetGenres was broken as well. I fixed it in https://github.com/xbmc/xbmc/commit/0e481881912d69ab26085e076ddabd4b99f2e8ad


- Mizaki - 2012-01-21

That's great, thanks.

Any likely verdict on the subtitle on/off notifications etc?


- Tolriq - 2012-01-22

It seems there's a little bug with audiostreams attribute of Player.GetProperties.

The Player.Audio.Stream.Extended part is not populated only the Player.Audio.Stream.

This part is correctly filled with the currentaudiostream attribute.


- Montellese - 2012-01-22

Tolriq Wrote:It seems there's a little bug with audiostreams attribute of Player.GetProperties.

The Player.Audio.Stream.Extended part is not populated only the Player.Audio.Stream.

This part is correctly filled with the currentaudiostream attribute.

Thanks for the report. That was a bug in the introspect and has been fixed in https://github.com/xbmc/xbmc/commit/ae6618fe7d3bfa0708a13dfcb2e37e7329daf404. "audiostreams" property only returns "Player.Audio.Stream" and not "Player.Audio.Stream.Extended" (which is only available for the "currentaudiostream" property).


- Tolriq - 2012-01-22

Hum that makes comparing of audiostreams and current very specific to XBMC. Too bad the informations can"t be returned.

Another question about subtitles when we send a SetSubtitle and subs are off, they are not forced on, so we need to do 2 queries. Perhaps add a param to force on or auto force on since we are choosing a specific sub we surely want to see it displayed.


- Montellese - 2012-01-22

Tolriq Wrote:Hum that makes comparing of audiostreams and current very specific to XBMC. Too bad the informations can"t be returned.
I simply don't get that information from the active player. It is only loaded for the current audiostream, but I still thought it wouldn't hurt to return the extra information for the current audiostream. If you want to have the same handling for "audiostreams" and "currentaudiostream" you can simply ignore the additional properties provided by "currentaudiostream".

Tolriq Wrote:Another question about subtitles when we send a SetSubtitle and subs are off, they are not forced on, so we need to do 2 queries. Perhaps add a param to force on or auto force on since we are choosing a specific sub we surely want to see it displayed.
Please create a feature request ticket for that as the JSON-RPC API for Eden has been frozen (unless there is something that makes using a method impossible). For now you can send a batch request containing the two requests. Batch requests make sure they are executed in the order they are provided in the request so you can first change the subtitle and then enable it.


Simple controls for XBMC - Fliposide - 2012-01-22

Hi All,
I been reading all about JSON and HTTP etc
What I want to get a simple remote control for XBMC, basic navigation, and transport control within my own home control system, made using Demopad software (a custom control application to enable you yo program a iPad or iPhone as a universal remote).

However I am having trouble.

I started out with POST commands and sending HTTP but it didn't seem reliable and many commands not available. I then moved to JSON rpc which appears to be the way forward but again having problems..

Example HTTP code to move Pause playback. This code is assigned to a button in Demopad software to issue it.

Code:
http://xbmc:[email protected]:8080/xbmcCmds/xbmcHttp?command=Pause()

Example JSON code to move to Pause Audio

Code:
{"jsonrpc": "2.0", "method": "AudioPlayer.PlayPause", "id": 1}

While each work each API is lacking certain functions. On calling JSONRPC.Version I get a result of 2.0

Am I missing something or a complete list of commands etc?

Like I said all I need is UP,DOWN,LEFT,RIGHT,SELECT. PLAY,PAUSE,STOP,OSD,ZOOM,SUBTITLES etc.

I don't need all the feedback as to what is playing now, and artist info etc. etc as I can see all that from the large screen in front of me Wink

I suspect part of the issue is I am on version 2.o of JSON but how do I upgrade it? I am running XBMC from the OPENELEC install currently and is that current version (Dharma). But if this is the case how do third party apps on the Iphone work on my version now like Constellation to name one?

Any help or list of commands would be very handy, thanks

Cheers,
Flipside.


- Tolriq - 2012-01-22

Montellese Wrote:I simply don't get that information from the active player. It is only loaded for the current audiostream, but I still thought it wouldn't hurt to return the extra information for the current audiostream. If you want to have the same handling for "audiostreams" and "currentaudiostream" you can simply ignore the additional properties provided by "currentaudiostream".


Please create a feature request ticket for that as the JSON-RPC API for Eden has been frozen (unless there is something that makes using a method impossible). For now you can send a batch request containing the two requests. Batch requests make sure they are executed in the order they are provided in the request so you can first change the subtitle and then enable it.

Ticket open : http://trac.xbmc.org/ticket/12503

Forget about batch thanks for reminding this one that i use on other places ....


@Fliposide : We use the eventserver for most part of the remoting, lot's are missing from Json, hoping all is ported for version after Eden Smile


- mikebzh44 - 2012-01-24

Hello.

I'm trying to understand JSONRPC to query video database.

Is there a way to request all movies in database and retrieve all properties without listing them ?

For the moment, I use :

Quote:json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": {"properties": ["fanart", "thumbnail", "file"]}, "id": 1}')

But I have to list all the properties and I need all properties (for applying smartplaylist on them).

I have try :

"properties": ["all"]

without success.

I remember a doc on the official XBMC site listing properties show in a tabular way and for each property say if the property is available for Movies, Episodes, ...

Somebody can give me the link to this document ?

Thanks.


- wuench - 2012-01-25

Fliposide Wrote:Hi All,
I been reading all about JSON and HTTP etc
What I want to get a simple remote control for XBMC, basic navigation, and transport control within my own home control system, made using Demopad software (a custom control application to enable you yo program a iPad or iPhone as a universal remote).

However I am having trouble.

I started out with POST commands and sending HTTP but it didn't seem reliable and many commands not available. I then moved to JSON rpc which appears to be the way forward but again having problems..

Example HTTP code to move Pause playback. This code is assigned to a button in Demopad software to issue it.

Code:
http://xbmc:[email protected]:8080/xbmcCmds/xbmcHttp?command=Pause()

Example JSON code to move to Pause Audio

Code:
{"jsonrpc": "2.0", "method": "AudioPlayer.PlayPause", "id": 1}

While each work each API is lacking certain functions. On calling JSONRPC.Version I get a result of 2.0

Am I missing something or a complete list of commands etc?

Like I said all I need is UP,DOWN,LEFT,RIGHT,SELECT. PLAY,PAUSE,STOP,OSD,ZOOM,SUBTITLES etc.

I don't need all the feedback as to what is playing now, and artist info etc. etc as I can see all that from the large screen in front of me Wink

I suspect part of the issue is I am on version 2.o of JSON but how do I upgrade it? I am running XBMC from the OPENELEC install currently and is that current version (Dharma). But if this is the case how do third party apps on the Iphone work on my version now like Constellation to name one?

Any help or list of commands would be very handy, thanks

Cheers,
Flipside.

For that functionality in 10.2 you need to use either the HTTP API which is slated to go away, or the EventServer which I don't think is. Most of the apps I have seen use those.

Now some of that functionality is included in JSONRPCv3 which only works on Pre-Eden on up.

For my project I started from scratch for Eden JSON and EventServer with the hopes to drop the EventServer code as more functionality is added to JSONRPC and will try to support two versions (older version used a combination of HTTP API and JSON).


- mikebzh44 - 2012-01-25

OK, I was looking for this document :

http://wiki.xbmc.org/index.php?title=Smart_Playlist#Fields

But, when calling method VideoLibrary.GetMovies, can I use those parameters for properties :
"params": {"properties": ["fanart", "thumbnail", "file"]}
Because "file" or "thumbnail" are not listed.

When can I found a list of all properties available for each method (GetMovies, ...) and related to database fields (http://wiki.xbmc.org/index.php?title=XBMC_databases#The_Video_Library).

Thanks.


- Montellese - 2012-01-25

SmartPlaylists have nothing to do with the properties of VideoLibrary.GetMovies in JSON-RPC. The available fields highly depend on what version of XBMC you are using. If you are using Dharma (10.0 or 10.1) there is no list of available properties because it's documentation is very poor. If you are using pre-Eden (nightly builds, Eden Beta 1 or 2) you can use JSONRPC.Introspect to get a full description of all the methods and parameteres/values they take. For the properties available for VideoLibrary.GetMovies in particular you can look here: http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v3#Video.Fields.Movie (you will need to click on the "Show" link on the right hand side of "JSON Schema Description" below the "Video.Fields.Movie" title).