• 1
  • 115
  • 116
  • 117(current)
  • 118
  • 119
  • 226
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC
Mizaki Wrote:On a similar note and probably another silly question by me but how can I get the limit of items?

I'm not at home to test atm but I assume I can use limits start and end. My real question I guess, is how do I know the end without having to do a full call on a library?

Well whenever you call one of the FooLibrary methods JSON-RPC will always run the full query independant of what you have set in the "start" and "end" properties of the "limits" parameter. But if you don't retrieve all the items (by specifying start and end) you will still get the "total" property in the "limits" object of the result which will always tell you the size of all the available items.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
To re-confirm then. There is no way to mitigate against a large library and slow machine (ATV2 for example)? The problem is, by the sounds of it, I have someone who is timing out on the call before the results can be returned.
Image
AWXi - Ajax web interface. Wiki
Reply
Currently not because no matter what parameters you pass JSON-RPC will always retrieve all the matching items and then do the sorting and after that the limiting.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
carmenm Wrote:That makes sense and might just be it as i know i ask for cast (to create a DB of actors). Will try that tomorrow, and share the result.
And it appears i will have to find another way to create an actor DB.

Ok so i just made the test with my atv2 and you were RIGHT!
Without cast: 267 movies -> 3-4sec
With cast : 267 movies -> 20-25 sec!!!!

Will have to find another way to sync actors/roles

Thanks a lot
Reply
Hi,

I love the 'new' JSON API! At the moment I am writing a script for my Philips Pronto remote control.

Whenever it 'wakes up' from sleep, I have to do 3 requests:
1) GetActivePlayer: to check if the active player has changed while the remote was sleeping
2) Player.GetProperties (if 1 returned a player): to get the player status
3) Player.GetItem: to check if the played video/song changed.

It would be handy if I could do this with 1 or 2 calls only.
GetActivePlayer could e.g. return the speed and the library id of the currently played item.

I cache the library item id to check if the playback item has changed, in which case I download the new data with Player.GetItem.

Or does such a call already exist to fit my needs ?

Thanks for your work !
Reply
No but you can do 2) and 3) in a batch request i.e. send them together in one request and receive the response together as well. You still need to parse and evaluate them seperately but you save some time because you don't have to wait for 2) to finish before sending 3).
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
Thanks for your (very) fast response Smile

How do you mean, send them in batch ?
How doest that look ? Are they encapsulated ?
Reply
For batch requests see http://jsonrpc.org/spec.html and scroll down to "Batch" and there are also some examples of batch requests at the end of the page.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
Hi,

I am writing an async .Net Library (C#) for the JSON-RPC API. The code is available on Github (https://github.com/mjeanrichard/XBMC-Net-Library) if anybody is interested. Most of the Types are automatically generated from the JSON.Introspect-Schema.

Any suggestions / inputs are welcome!

Cheers
Meinrad
Reply
I am trying to get the length or "duration" of a movie but the results do not return. I am displaying currently playing items and when a song is selected it displays the duration but not when a movie is played. Is there a different property i should be requesting?

{"jsonrpc":"2.0","id":10,"method":"Player.GetItem","params":{"playerid":'+inttostr(GetActivePlayer)+',"properties":["thumbnail","artist","duration","album"]}}

results if movie:
{"id":10,"jsonrpc":"2.0","result":{"item":{"album":"","artist":"","id":133,"label":"Abduction","thumbnail":"special://masterprofile/Thumbnails/Video/3/3ce2f0b8.tbn","type":"movie"}}}

results if song:
{"id":10,"jsonrpc":"2.0","result":{"item":{"album":"The Black Parade","artist":"My Chemical Romance","duration":299,"id":1028,"label":"Famous Last Words","thumbnail":"special://masterprofile/Thumbnails/Music/8/8546d948.tbn","type":"song"}}}
Reply
Yes you need to request the "runtime" property for video items. But that property is a string and can contain things like "mins" etc. An alternative is to also retrieve "streamdetails" and look at the video stream. It should contain a seconds-based number for the length of the stream. Can't remember the name off the top of my head so look into introspect, the wiki or the response of your request.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
I am trying to build a webinterface for my iPhone which also will be sending out IR commands to my reciever. In the new JSON-RPC Api I can't find anything that will help me with that. Is that correct? Should I use a different technique for that?
Reply
What does XBMC's JSON-RPC have to do with IR commands? I have no clue but I don't know about XBMC's core being able to send IR commands.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
I thought the JSON-RPC is the way to go to communicate with XBMC. Since the Wikipage says the HTTPApi is depreciated.

However I wasn't able to use JSON-RPC to use one of the Builtin commands, which is quite easy using the HTTPApi. I'm using the HTTPApi now to execute Lirc.Send, which is fine by me.
Reply
Ah right. Yeah the JSON-RPC API will not allow direct access to the Builtin commands. These are generally meant for XBMC internal purposes and for skins. Certain builtin commands are wrapped in JSON-RPC commands (with parameter-checking etc) if necessary. I'm not sure but maybe the EventServer allows access to the builtin methods as well.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
  • 1
  • 115
  • 116
  • 117(current)
  • 118
  • 119
  • 226

Logout Mark Read Team Forum Stats Members Help
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC8