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)



- khargy - 2011-10-09

Ok, so this is interesting... sometimes when I called my video playlist I would use "path" and sometimes I would use "file", so:

Code:
{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "path": "special://profile/playlists/video/all videos.m3u"  } }, "id": 1 }

Code:
{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "special://profile/playlists/video/all videos.m3u"  } }, "id": 1 }

if I use "file" it plays the video in order, but if I use "path" it plays them randomly... but with "path" it seems to be playing them in player ID 2 which, if I understand things correctly is the picture player.

Although I'm still getting the issue where on the 2nd play it'll get stuck on the GUI - sometimes it'll say "loading" forever, but if I just send the play.open command again it'll go.


- Montellese - 2011-10-09

khargy Wrote:So after I called player.open for the video playlist I called:

Code:
{"jsonrpc": "2.0", "method": "Player.Shuffle", "params": [1], "id": 1}

I get an "ok" result but when I go to the next item it's still in order.
I'll have to investigate this later. I only tried it with playlist I created within XBMC (using the "Queue" option from the context menu) and there it worked fine.

khargy Wrote:Ok, so this is interesting... sometimes when I called my video playlist I would use "path" and sometimes I would use "file", so:

Code:
{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "path": "special://profile/playlists/video/all videos.m3u"  } }, "id": 1 }

Code:
{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "special://profile/playlists/video/all videos.m3u"  } }, "id": 1 }

if I use "file" it plays the video in order, but if I use "path" it plays them randomly... but with "path" it seems to be playing them in player ID 2 which, if I understand things correctly is the picture player.

Although I'm still getting the issue where on the 2nd play it'll get stuck on the GUI - sometimes it'll say "loading" forever, but if I just send the play.open command again it'll go.

Yeah the "path" parameter is meant for slideshows only whereas the "file" parameter can take any kind of media (but not a directory full of media files in which case you should use the "directory" parameter instead of the "file" parameter).


- grywnn - 2011-10-10

Just noticed that Files.getSources no longer returns a file/directory name per source, only a label (XBMC OS X, build from 10/09).
Pretty useless this way Smile
Got no time to open a ticket, but can do tomorrow if necessary.

BTW Player.getItem is GREAT!


- Montellese - 2011-10-10

grywnn Wrote:Just noticed that Files.getSources no longer returns a file/directory name per source, only a label (XBMC OS X, build from 10/09).
Pretty useless this way Smile
Got no time to open a ticket, but can do tomorrow if necessary.
Thanks for the report. I fixed it in https://github.com/xbmc/xbmc/commit/69ea94f3f485e2f5530c6b122c1ad1b07f8cffa4 so should be fixed in the nightly of tomorrow or the day after tomorrow.

grywnn Wrote:BTW Player.getItem is GREAT!
Glad to hear that.


- grywnn - 2011-10-10

You're my hero Smile


Thanks! - joshua.lyon - 2011-10-11

Montellese Wrote:As you can see we already had to break backwards compatibility for all those namespaces just to get a clean API on which we can build in the future without having to break backwards compatibility again.

topfs2 Wrote:The API is far from backwards compat already in the move from v2 -> v4 (even if not great changes), thus we decided that we might aswell do ALL non-backwards compat changes which has bugged us. This to make less changes (perhaps even keep backwards compat) in the next upcomming versions.

EDIT: Also you all should consider v2 (dharma) to have been just a taste of whats to come, it was never really finished and was mostly added as a showcase. Eden (v4) is looking rather finished and polished. While we have lots of ideas for the future it is very cleaned out and should be maintainable.

Thanks for the feedback, guys.

I guess I should look at this as a blessing in disguise. It sounds like some of the things in the V2 JSONRPC APIs that have forced me to alternative APIs / methods (eg: HTTP-API) are being improved in the next release of the JSONRPC API.


- Montellese - 2011-10-14

Friday, October 14th 2011:
Commit: 53ee2724ede510a8a3a0
  • Refactored Files.Download into Files.PrepareDownload and Files.Download. Using jsonrpc over HTTP Files.PrepareDownload does, what Files.Download did until now. It provides a URL which can be called to download the file (beware the answer format has changed). The idea behind the changes is that some transport layers will support direct download through Files.Download while others (like HTTP) will not and in that case the method name "Download" may be confusing. That's why we split the functionality into Files.PrepareDownload (which will be available over HTTP) and Files.Download (which will not be available over HTTP because it's not supported).



- mzanetti - 2011-10-15

Hi,

Thank you once again for the work on this API. My remote control app is turning out great and has already quite a lot of users. One feature request that pops up frequently is to add things like "c" or "i" to the Input namespace to be able to open the context menu and info dialogs.

Another one is the ability to downscale images on the server to be able to browse the image library using previews. Downloading the whole images and downscaling them on the client is not an option for mobile phones.

What do you think? Do those features make sense and perhaps are already on your todo list?


- Montellese - 2011-10-15

mzanetti Wrote:Hi,

Thank you once again for the work on this API. My remote control app is turning out great and has already quite a lot of users. One feature request that pops up frequently is to add things like "c" or "i" to the Input namespace to be able to open the context menu and info dialogs.
Please create a feature request ticket for these two (one ticket for each features is prefered).

Another one is the ability to downscale images on the server to be able to browse the image library using previews. Downloading the whole images and downscaling them on the client is not an option for mobile phones.[/quote]
That one is on the todo list and I think there already is a feature request ticket for it. Certainly something we'd like to add rather sooner than later.


- jasonvp - 2011-10-16

mzanetti Wrote:Hi,

Thank you once again for the work on this API. My remote control app is turning out great and has already quite a lot of users. One feature request that pops up frequently is to add things like "c" or "i" to the Input namespace to be able to open the context menu and info dialogs.

I was going to suggest that also.

@Montellese
How long do you think the HTTP API will be in use for?


Cheers
Jason


- Montellese - 2011-10-16

jasonvp Wrote:@Montellese
How long do you think the HTTP API will be in use for?

We want to get rid of it ASAP after Eden has been released. I'm aware that this will cause problems with some applications that use methods that are not exposed by jsonrpc but the team decided that some of the things exposed by the http api should not be made accessible to third party applications the way it has been done by the http api (which sometimes is done through very fugly hacks) so we might have to drop some things and re-introduce them later in jsonrpc but only if we find a nice and controllable way to expose them.


- othrayte - 2011-10-16

Montellese Wrote:We want to get rid of it ASAP after Eden has been released. I'm aware that this will cause problems with some applications that use methods that are not exposed by jsonrpc but the team decided that some of the things exposed by the http api should not be made accessible to third party applications the way it has been done by the http api (which sometimes is done through very fugly hacks) so we might have to drop some things and re-introduce them later in jsonrpc but only if we find a nice and controllable way to expose them.

I've been meaning to speak up about this for a while, in Trakt Utilities we use the json rpc extensively but there are a few things we still need to use the httpapi for, and for all of these we are making direct requests to the db. The following are the things we are currently using it for:
  • Changing the playcount of a movie or episode
  • Get the local movieid or showid given an imdbid/tvdbid or title

What we are really after and would find useful is to be able to edit the data in the db (though I can see that we might need to discuss the correct secure way of doing this) and the second would be to be able to get a list of items when we know some detail other than the localid, liek the imdb_id or title, some kind of filtering.


- Montellese - 2011-10-16

othrayte Wrote:I've been meaning to speak up about this for a while, in Trakt Utilities we use the json rpc extensively but there are a few things we still need to use the httpapi for
We are looking for any feedback we can get on what we still need to migrate from http api to jsonrpc. We cannot promise that we will migrate everything available in http api (one example is the direct db access) or in exactly the same way but if we don't even know what is missing we can't add it.

othrayte Wrote:
  • Changing the playcount of a movie or episode
I have already done some work on this which will allow to call something like VideoLibrary.SetMovieDetails() and provide some fields and values which should be changed. It's not completely ready yet as we don't know yet how to make certain that nothing goes sideways if an application executes a call that will set invalid data, but this is something we want to make available soon after Eden has been released.

othrayte Wrote:
  • Get the local movieid or showid given an imdbid/tvdbid or title
"Custom" db queries through jsonrpc have been requested a few times already. The problem is that XBMC itself doesn't really support this (apart from browsing by year, director etc). So json-rpc would have to hack around the lack in xbmc core which isn't a very good solution IMO.


- othrayte - 2011-10-16

Montellese Wrote:I have already done some work on this which will allow to call something like VideoLibrary.SetMovieDetails() and provide some fields and values which should be changed. It's not completely ready yet as we don't know yet how to make certain that nothing goes sideways if an application executes a call that will set invalid data, but this is something we want to make available soon after Eden has been released.
Great, I look forward to seeing this.

Montellese Wrote:"Custom" db queries through jsonrpc have been requested a few times already. The problem is that XBMC itself doesn't really support this (apart from browsing by year, director etc). So json-rpc would have to hack around the lack in xbmc core which isn't a very good solution IMO.
Yeah, we are moving to a fully cached system in TU, which should hopefully make TU act closer to the way XBMC expects, this should reduce or eliminate our major need for this, the real reason we currently use this is when we want to play an item and we know:
  1. That is is in the db
  2. The imdb id, title & year (We currently only support this for movies)

But what I'm trying to say is that future versions of TU will probably not need custom queries, but it would be helpful to do basic filtering of requests like, getMovies.


VFS NFS shares - FSS_Dawid - 2011-10-16

I just found a bug. Im using the new libnfs library in xbmc and my files are mapped in XBMC using the nfs://xxx.xxx.xxx.xx/folder/file.xxx protocol the problem is that the nfs protocol is not accessible via vfs

PHP Code:
http://10.0.1.28:8080/vfs/nfs%3A%2F%2F10.0.1.4%2Fmnt%2Fuser%2FTVShows%2FBoardwalk%20Empire%2Ffile.xxx 

i get a response:
File not found... from the VFS.

BTW. grate Job on the JSON-RPC!!!
Kind regards
Dawid

EDIT:
Just tried to open a ticket for this problem but I can't register to trac Smile there's just the login option... Or I'm blind O_o ?