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)



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - erhnam - 2012-06-11

Question; now AE is in, how hard would it be to build functionality to get a list with audio devices and default to a new one?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-06-11

Getting the list of audio devices would probably be easy/easier but changing the setting is still as hard as it was before. The problem is that the whole GUI settings stuff is built to be changed through the GUI and not through some call in the rest of the code. So just changing the value of the setting itself won't do anything to the rest of XBMC. It has to somehow work through all the appropriate code in CGUISettings/CGUIWindowSettingsCategory which is not publicly exposed to the rest of the code.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Hitcher - 2012-06-15

I've been using this script to update the video library whenever SABnzbd downloads a movie just fine with Eden -

PHP Code:
#!/bin/sh

wget --O/dev/null --header='Content-Type: application/json' --post-data='{"jsonrpc": "2.0", "method": "VideoLibrary.Scan"}' http://localhost:8080/jsonrpc 

but since changing to nightly builds I get this error -

Code:
wget: server returned error: HTTP/1.1 415 Unsupported Media Type

Can someone please help me out?

Thanks.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-06-15

Hm that error means that you didn't provide the correct Content-Type but as you explicitly set it to application/json it should be fine. I'll have to give it a try later on and take a look at the actually sent data with Wireshark.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Hitcher - 2012-06-15

Thanks.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-06-15

Only gave it a quick spin on win32 and the HTTP request received by XBMC contains "Content-Type: application/x-www-form-urlencoded" and not application/json. So something must be wrong with the wget call.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-06-15

@Hitcher: OK, I've taken a closer look. At least on win32 it works when you replace the single-quote characters with double-quote characters i.e.
Code:
--header="Content-Type: application/json"
With just that it still didn't work on win32, I also had to replace the single-quotes around the JSON-RPC request with double-quotes and escape all the double-quotes in the JSON-RPC requests with a backslash. Then everything was golden. Not sure though if that is win32 specific as the JSON-RPC request part seems to have worked for you for Eden.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-06-15

Tested it and single quotes works fine for me in Linux. The


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Hitcher - 2012-06-15

Thanks for looking but it's the same error. Maybe it's something to do with the OpenELEC version I'm using.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-06-17

I see it's been discussed somewhat but is a resume option and/or a "play from" param with player.open worth a FR? I guess currently it's a player.open then player.seek deal?

Ta.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-06-17

(2012-06-17, 20:38)Mizaki Wrote: I see it's been discussed somewhat but is a resume option and/or a "play from" param with player.open worth a FR? I guess currently it's a player.open then player.seek deal?

Have you taken a look at Player.Open in the nightly builds? It has a new "options" parameter which can take a "resume" property which can either be a boolen (to use whatever resume point xbmc has stored), a percentage value from where to start or a "Player.Position.Time" value to provide the starting point as hh:mmConfuseds. I think that should cover everything you want to do with resume. If not, let me know.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-06-17

I was looking at Eden and the FRs, didn't think to check Frodo Undecided Now you've said it, it rings a bell. I can't imagine needing anything else. Thanks.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-06-22

Quick question on PR: "jsonrpc: make use of the new sorting and limiting functionality" Will limits.total still be the total number in the library or the total of the request. So, start: 0, end: 24 the total would be 25 or library total?

And am I right in thinking at some point I could ask for all the movies starting with "A" for example? Basically creating on-the-fly smart playlists via JSONRPC?

Sorry if this has been covered before. Just looking for some confirmation before I continue making changes Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-06-22

Hm good question on the "total" value. I actually haven't looked at it. Might be that it will need some extra query to retrieve the maximum number of items. Thanks for bringing it up.

Yes my "vision" is to add a "filter" parameter to all the FooLibrary.GetBar methods which will take an object of the same format as smartplaylists are stored, just in JSON and not in XML. That would provide maximum flexibility while still making sure that nobody has to write custom SQL queries.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-06-22

If it is the total library number that'll help me out tbh. Atm I'm getting a fixed amount, say 25, with a next and previous button. Without the total being the library total I'll have to query the whole library to cycle backwards (previous button) which would be a bit pointless because we are trying to get around a long query/timeout. So, at the moment I don't cycle backwards if starting at 0.

I have a question on "party mode" as well. I'm a little fuzzy on the details as I don't use it but a user has brought up the issue https://github.com/frolick/AWX-Eden/issues/71#issuecomment-6516204 and am I right in thinking:
There is no way to start partymode via JSONRPC. I've looked at player.open and I guess it should be one of the "options"?
Party mode basically runs a smart playlist and re-generates it after every item. Not strictly JSONRPC related but it's relevant as with player.open you'd need to specify a smart playlist with the "partymode" option.