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.
Quote:That's not possible right now but it's a good idea. Can you create a feature request ticket for it and CC me? We could either return an additional property "excluded" for every source or we could add a parameter with which you can specify wether to provide the excluded sources as well.

Thanks, done.

http://trac.xbmc.org/ticket/12354
Is there any notification/announcement or other way to tell when a VideoLibrary.Scan has finished. That is, when XBMC has finished scanning and updating the Video Library?

Thanks,
bradvido
bradvido88 Wrote:Is there any notification/announcement or other way to tell when a VideoLibrary.Scan has finished. That is, when XBMC has finished scanning and updating the Video Library?

Nope there isn't right now. But you can open a feature request ticket for it.
Montellese Wrote:Okay but that's still with a remote directory and not a local one.

Sorry for not coming back sooner. As I use live XBMC distro upgraded to preEden, so I don't have any video files locally. I'm not good at linux, can you tell me how can I copy some files to the hdd to be able to check this? Thanks
Vasik
Is there any way to force the retrieval of video metadata if XBMC hasn't gotten it already? I really need to figure out the duration of video files that are in the user's library but no metadata is there yet.
For what i know xbmc will add the metadata when you do a library scan.

But if the NFO does contain data this data will be used Sad even is the data is empty.

The solution i choose is Ember with automated scan of only metadata and disable all data plugins. So it's only update the nfo with up2date metadata. Not perfect but quick and easy solution Smile
vasikgreif Wrote:Sorry for not coming back sooner. As I use live XBMC distro upgraded to preEden, so I don't have any video files locally. I'm not good at linux, can you tell me how can I copy some files to the hdd to be able to check this? Thanks
Vasik

I don't use linux either so I can't really help you there sorry.

Jason102 Wrote:Is there any way to force the retrieval of video metadata if XBMC hasn't gotten it already? I really need to figure out the duration of video files that are in the user's library but no metadata is there yet.

No JSON-RPC does not provide a Refresh method or something like that. Not even sure if the Refresh functionality in XBMC retrieves the metadata.
There might be a problem with empty directories and the response form GetDirectory

http://forum.xbmc.org/showpost.php?p=973729&postcount=5

the response fails eval()
null_pointer Wrote:There might be a problem with empty directories and the response form GetDirectory

http://forum.xbmc.org/showpost.php?p=973729&postcount=5

the response fails eval()

Well that's because in python there is no "null" as they call it "None" but "null" is a valid type/value in JSON (see http://www.json.org/). There are also other calls which might return "null" as a value for a certain property. You should use a json(-rpc) library to handle the responses in python even though python uses a very similar (but not identical) object representation as JSON does.

In that particular case though it would also make sense to return an empty array (i.e. "[]") instead of null which might make overall parsing simpler.
Quote:You should use a json(-rpc) library to handle the responses in python
Excellent, thanks.
I am trying to use Player.SetSpeed. When passing a zero or negative value I am getting back the error, positive values work.

If I don't quote the values I get:
{"jsonrpc":"2.0","method":"Player.SetSpeed","params":{"playerid":1,"speed":-1},"id":0}

{"error":{"code":-32602,"data":{"method":"Player.SetSpeed","stack":{"message":"Received value does not match any of the union type definitions","name":"speed","type":["string","integer"]}},"message":"Invalid params."},"id":0,"jsonrpc":"2.0"}


If I quote the values I get:
{"jsonrpc":"2.0","method":"Player.SetSpeed","params":{"playerid":1,"speed":"-4"},"id":0}

{"error":{"code":-32602,"data":{"method":"Player.SetSpeed","stack":{"message":"Received value does not match any of the defined enum values","name":"speed","type":["string","integer"]}},"message":"Invalid params."},"id":0,"jsonrpc":"2.0"}

Running Eden Beta 1.

Am I constructing the command correctly?
wuench Wrote:I am trying to use Player.SetSpeed. When passing a zero or negative value I am getting back the error, positive values work.

If I don't quote the values I get:
{"jsonrpc":"2.0","method":"Player.SetSpeed","params":{"playerid":1,"speed":-1},"id":0}

{"error":{"code":-32602,"data":{"method":"Player.SetSpeed","stack":{"message":"Received value does not match any of the union type definitions","name":"speed","type":["string","integer"]}},"message":"Invalid params."},"id":0,"jsonrpc":"2.0"}


If I quote the values I get:
{"jsonrpc":"2.0","method":"Player.SetSpeed","params":{"playerid":1,"speed":"-4"},"id":0}

{"error":{"code":-32602,"data":{"method":"Player.SetSpeed","stack":{"message":"Received value does not match any of the defined enum values","name":"speed","type":["string","integer"]}},"message":"Invalid params."},"id":0,"jsonrpc":"2.0"}

Running Eden Beta 1.

Am I constructing the command correctly?

No it was broken in XBMC because I introduced union types. I fixed it in https://github.com/xbmc/xbmc/commit/fabc...f11af6253c
Thanks for reporting it.
Thanks. FYI, I also posted a bug about the navigation commands not playing the action sounds that got fixed 2 hours after posting. Awesome!
Yeah I saw that one as well but vdrfan was faster than me Wink
Hi,

No possibility to put methods :
"LiveTV.GetChannelGroupDetails"
"LiveTV.GetChannels"
"LiveTV.GetChannelDetails"
"LiveTV.GetEpgDetails"

like you did : https://github.com/Montellese/xbmc/tree/pvr


Regards