XBMC Community Forum
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Development (/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (/forumdisplay.php?fid=174)
+---- Thread: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263)



- Montellese - 2011-11-14 11:11

Currently there is no parallelism or anything and every request is stalled until the previous request has been finished but in the future we are planning to handle requests in seperate threads. This makes it possible to execute fast requests while slow requests are still being processed (e.g. calling JSONRPC.Ping while VideoLibrary.GetMovies returns 1000+ movies etc).

So if you want to be on the safe side (i.e. future proof) you need to wait till you got the response for the Player.Open request before sending the Player.Seek request. The JSON-RPC 2.0 specification states that it is not required to keep the order of requests even in batch requests.

For the particular case of resuming playback I am planning to add a "options" parameter to Player.Open which will allow to specify a resume point.


- Montellese - 2011-11-15 21:42

grywnn Wrote:Me again Rolleyes

Bug?
When i use Playlist.Swap and the position of the currently playing item changes, Player.getProperties doesn't reflect the changes afterwards.

Example:
Currently playing item 2 of playlist 0.
Now i swap item 1 and 2.
The item formerly known as item 2 continues to play, but is now on position 1.
But Player.getProperties will still return position 2.
This goes as far that even the music playlist on XBMCs screen reflects the swap, but highlights the wrong track.
Finally got around to fix this bug in https://github.com/xbmc/xbmc/commit/d187b1c2197c4477ba22f5364a3044cc1be46045 so it should now behave as you expect it to.


- grywnn - 2011-11-15 22:16

Montellese Wrote:Finally got around to fix this bug in https://github.com/xbmc/xbmc/commit/d187b1c2197c4477ba22f5364a3044cc1be46045 so it should now behave as you expect it to.
Thanks a ton, will test and report tomorrow.


- jimk72 - 2011-11-16 01:25

dwagner Wrote:I'm wondering if anybody else has run into this problem.

If I send to the JSON Api (via TCP) two or more requests right away (i.e. before the first one has had a chance to respond), more then likely I will then receive all the responses together as one piece of data. The standard JSON parsers on iOS will then complain that there is garbage after the end of the object.

I was having all kinds of problems like this with tcp. also had large requests(all artist, ect..) would be sent back in random chunks. I ended up switching over to http post ect.. that way I get the full response and it is only that response and then use the tcp to monitor for notifications. Most of them are very short so a custom parser to make sure it is only one notification was easy. All my problems related to JSON ended after that Smile


- Blacksheep70 - 2011-11-16 16:32

A method to query if XBMC is currently idle (TRUE|FALSE) would be useful.

E.g. to trigger special actions or maintenance on smaller machines when there is no media playing.

I personally would use this method to shut down the system automatically after the system was brought up automatically (to record TV) via ACPI wakeup if no media is currently playing.

Regards,

Blacksheep


- neoflex - 2011-11-16 16:36

Hi and sorry if this question has already been asked before.
I hope I am wrong but it seems that there is no method in the JSON Api to get the list of audio playlists in the audio library. Something like AudioLibrary.GetPlaylists ?
If it is the case, do you have plan to add this in the near future ?
(if not I might give it a try but that could results in some ugly code Tongue)


- rossmohax - 2011-11-16 19:53

Right now neiher JSON nor HTTP api interface have feature to manually update DM. As if you added new video, then tries get its info and parser cannot recognise its name, then it ask you to enter name of video and then queries IMDB with that name. Right no to do that I have to have keyboard attached to linux box.

I checked the code and it seems that there is no ready-made function which can be called from RPC handler, all "manual editing" of item name is done in GUI code.

But it would be nice to have such option.


- jimk72 - 2011-11-16 20:50

neoflex Wrote:Hi and sorry if this question has already been asked before.
I hope I am wrong but it seems that there is no method in the JSON Api to get the list of audio playlists in the audio library. Something like AudioLibrary.GetPlaylists ?
If it is the case, do you have plan to add this in the near future ?
(if not I might give it a try but that could results in some ugly code Tongue)

I access the directory the playlists are stored in and parse them. When one is selected I send each song from the list to xbmc using add to playlist then play that playlist. Works good for now.


- neoflex - 2011-11-16 22:59

jimk72 Wrote:I access the directory the playlists are stored in and parse them. When one is selected I send each song from the list to xbmc using add to playlist then play that playlist. Works good for now.

Thanks for the tip. I was looking for a more integrated solution to also integrate playlists from spotify but I can use a mix between both approaches maybe. Music playlists can be acceded through the http://***.***.***.***:8082/vfs/special://musicplaylists/***.m3u URL right ? but how can you get a listing of the files there ?


- Montellese - 2011-11-16 23:02

neoflex Wrote:Thanks for the tip. I was looking for a more integrated solution to also integrate playlists from spotify but I can use a mix between both approaches maybe. Music playlists can be acceded through the http://***.***.***.***:8082/vfs/special://musicplaylists/***.m3u URL right ? but how can you get a listing of the files there ?

Files.GetDirectory is what you are looking for if you wanna do the workaround.

FooLibrary.GetPlaylists() will be added as soon as it will be possible to load m3u (and other file based) playlists into the Playlist namespace but that's not gonna happen for Eden.