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.
Hi,

is there a way to set the playcount of a movie yet ?

I just got all the informations i need from all movies, but i want to set a movie as seen. (i want to sync seen movies between diffrent xbmc machines by using trakt)

thanks for help :-)
Manromen Wrote:is there a way to set the playcount of a movie yet ?

Altering the database through json rpc is not yet possible.
Okay thanks anyway. :-)
ook i use xbmc git:009d446
I connect correctly to my xbmc over telnet on 9090.
I start an scan from xbmc. I get nothing over telnet. WOuld it also be a way to feedbacks from xbmc? like "start playing", "paused", "started playing movie ..."?

Now i see that there is no command over json yet. So what would be the best way to make a remote for you right now?
is it UDP or something else? The thing is that i would like the user to only setup one address/port in the settings for easy access.
carmenm Wrote:ook i use xbmc git:009d446
I connect correctly to my xbmc over telnet on 9090.
I start an scan from xbmc. I get nothing over telnet. WOuld it also be a way to feedbacks from xbmc? like "start playing", "paused", "started playing movie ..."?

TCP port 9090 is correct (although this can be customized in latest git through advancedsettings.xml). You should also be able to send json rpc requests, receive responses and receive announcements like "Player.PlaybackStopped" or "Application.Quit" or whatever there is. I'm not sure what you're problem is?!
And I tried it, it works.

Code:
topfs@tobias-laptop:~$ telnet localhost 9090
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
{"jsonrpc":"2.0","method":"Announcement","params":{"data":{"content":"tvshow","tvshowid":1},"message":"UpdateVideo","sender":"xbmc"}}
{"jsonrpc":"2.0","method":"Announcement","params":{"data":{"content":"episode","episodeid":1},"message":"UpdateVideo","sender":"xbmc"}}
OK i get PlaybackPaused so it seems good. Yet i dont get updateLibrary reports. Maybe because there is nothing to update Wink
Anyway that s an amazing news!
Now do you know how to create a listening thread for 9090? I must say that i dont know how to create a telnet or something similar thread.
THanks for you amazing work!!!!!!

PS: where can i find the list of methods already implemented?
carmenm Wrote:PS: where can i find the list of methods already implemented?

For now the wiki page at http://wiki.xbmc.org/index.php?title=JSON_RPC is the best way of getting information about the available methods. Or you make the following json rpc:
Code:
{ "jsonrpc": "2.0", "method": "JSONRPC.Introspect", "id": 1 }
oh yeah thanks i forgot about Introspect Wink
carmenm Wrote:Now i see that there is no command over json yet. So what would be the best way to make a remote for you right now?
is it UDP or something else? The thing is that i would like the user to only setup one address/port in the settings for easy access.

If you want to use a single port for all control then use the HTTP port (default 8080). It will accept JSON and you can still use the HTTP API for the remote/navigation and other commands not implemented via JSON yet. The downside is you will lose the announcements that come over the 9090 socket.
Yes that exactly what bugs me Confused losing the announcements .... Maybe i ll make the user enter the address+port for the http, then put a special settings for telnet port. Right now if i underestood correctly you can only change it through advance settings so it s not for everyone.
I need a little putting my sync library into place.
I could ask regularly for VideoLibrary.GetMovies and parse all movies to see if new ones. BUt i would also need to update all the others. Moreover i would have to look at the library on my side and see if there are some that were not reported so that i delete them.

It seems extremly long to me. Does anyone see another way to do it?

Thanks
carmenm Wrote:I need a little putting my sync library into place.
I could ask regularly for VideoLibrary.GetMovies and parse all movies to see if new ones. BUt i would also need to update all the others. Moreover i would have to look at the library on my side and see if there are some that were not reported so that i delete them.

It seems extremly long to me. Does anyone see another way to do it?

IMO you'll always have to consider the possibility that the library is updated while your remote device is not connected with XBMC using JSON RPC. In that case there's no way around a complete sync anyway.
Hi Folks,
I've been trying to add content to audio playlist using json. I'm using the next command which works fine

Code:
curl -i -X POST -d '{"jsonrpc": "2.0", "method": "AudioPlaylist.Add", "params": { "albumid": 4, "media": "audio"}, "id": 1}' http://IP:8080/jsonrpc

it adds the album with id 4 in the DB to my AudioPlaylist
now I would like to add that content in either ascending or descending way...because it seems to be added randomly...
is there a way to sort the AudioPlaylist? I tried Suffle and UnShuffle but it didnt work

Thanks
I have a question. I am trying to send a switch show OSD command when playing.
I must use htttp interface as json doesnt implement this yet.
But my proplem is that using Action(24) it locks the GUI.
And i dont see a Key that would switch between show and hide OSD
Does anyone see a way to do that in JSON or HTTP?

Also to get nowplaying info (label, year, tagline ...) i read somewhere that i could use System.GetInfoLabels. Am I wrong? If not what parameter to use. If yes how i can i get it.

Thanks