Kodi Community Forum

Full Version: [LINUX][WINDOWS] JSON PRC Issues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

During development (C#) of remote controller over network, I've run into some odd XBMC Server behaviour. While sending "Files.GetDirectory" request to server on Linux machine (Ubuntu 11.04/11.10), I get a list sorted in a descending order, on the other hand when I send the same request to Windows 7 machine, I get a list sorted in ascending order as expected.

In addition, for some reason "AudioPlaylist.State" request returns an error
("AudioPlayer.State" request work just fine)

Request:
{\"jsonrpc\": \"2.0\", \"method\": \"AudioPlaylist.State\", \"id\": \"1\"}

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

Any clues? Thanks Confused
iSvinx Wrote:Hi,

During development (C#) of remote controller over network, I've run into some odd XBMC Server behaviour.
First of all I need to know what version of XBMC you are using? Since Dharma (10.0/10.1) I have more or less completely refactored JSON-RPC and the JSON-RPC API exposed by Eden will not be backwards compatible.

iSvinx Wrote:While sending "Files.GetDirectory" request to server on Linux machine (Ubuntu 11.04/11.10), I get a list sorted in a descending order, on the other hand when I send the same request to Windows 7 machine, I get a list sorted in ascending order as expected.
The sorting issue of Files.GetDirectory has been resolved a while ago in the nightly builds.

iSvinx Wrote:In addition, for some reason "AudioPlaylist.State" request returns an error
("AudioPlayer.State" request work just fine)

Request:
{\"jsonrpc\": \"2.0\", \"method\": \"AudioPlaylist.State\", \"id\": \"1\"}

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

Any clues? Thanks Confused
What makes you think that there is a AudioPlaylist.State method?

If you are planning on releasing your work to the public I'd highly recommend to work with the latest nightly builds (pre-eden) as JSON-RPC has changed a lot and you'd have to re-do all the work you've done for Dharma if you continue to work with the JSON-RPC API exposed in Dharma.
Hi,

I'm using Dharma 10.1 on both Linux and Win7 machines.
Where do I get "more or less completely refactored JSON-RPC" XBMC revision?
I've been following description from the WIKI Page (http://wiki.xbmc.org/index.php?title=JSON_RPC), Is it up to date? Where do i get a stable version of Eden, if exists?

AudioPlaylist.State method is found on wiki page reference. Quite strange question to ask... Please go on Smile

How can I code while the XBMC JSON-RPC API is changing on a week basis?

Thanks!
iSvinx Wrote:I'm using Dharma 10.1 on both Linux and Win7 machines.
The documentation in the wiki is for a nightly build from a few weeks back and differs a lot from what was/is available in Dharma 10.1.

iSvinx Wrote:Where do I get "more or less completely refactored JSON-RPC" XBMC revision?
For windows you can download nightly build from http://mirrors.xbmc.org/nightlies/win32/

iSvinx Wrote:I've been following description from the WIKI Page (http://wiki.xbmc.org/index.php?title=JSON_RPC), Is it up to date?
Unfortunately not. The best way to get a detailed documentation of what JSON-RPC offers in a specific XBMC version is to call JSONRPC.Introspect (the output in Dharma is not complete but in latest nightly builds the output from that method is the best documentation you can find).

To get a general idea of what has changed since Dharma you can take a look here: http://wiki.xbmc.org/index.php?title=Ede...s#JSON-RPC
It is not very detailed and a few things might be missing but it gives a rough idea of what has changed.

iSvinx Wrote:Where do i get a stable version of Eden, if exists?
There is no stable release of Eden yet as it is still in development but a first beta release should be out soon.

iSvinx Wrote:AudioPlaylist.State method is found on wiki page reference. Quite strange question to ask... Please go on Smile
Ah I remember that method was available for a very short time but then it was refactored and removed so I didn't even remember it actually existed. Sorry about that.

iSvinx Wrote:How can I code while the XBMC JSON-RPC API is changing on a week basis?
The weekly changes are over. If there should be any more changes to JSON-RPC until Eden is released they are either bugfixes or very small cosmetic changes. After Eden has been released we will try our best not to change the existing API and concentrate on adding new functionality/methods to extend to features offered by JSON-RPC.
Well, it was very helpful Rofl

Thanks!
Hi,

I'm using a "Pre-Eden" Nightly, one of the last ones (Compiled on 2 Nov. 2011).
Are there a recursive parameter for Playlist.Add method to add files and folder recursively using only one call?

Thanks Smile
Nope you can only add files from a single directory expect if you start a slideshow which can be done recursively.
Thanks Smile