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 - edrikk - 2014-10-18

Thank you both SO much!

It's good to know its a known issue regarding the thumbnail...
I'll double check/post my code in a couple of hours when the kids are asleep... Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - edrikk - 2014-10-18

Hi guys,

Here's my sample of my code which doesn't seem to respect the time for the notification.


Code:
#!/bin/sh

syslog_file="/share/Recordings/syslog.log"

##########
### Get caller ID and store in variable
my_curl_result=$(/bin/grep -i 'CID to deliver' "$syslog_file" | /usr/bin/tail -1 "$syslog_file" | /bin/sed -n -e 's/^.*deliver: //p' | /bin/sed -e "s/'//g")

##########
### Show ID on XBMC via CURL
/sbin/curl --data-binary '{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Phone Call","message":"'"$my_curl_result"'"},"displaytime":50000,"id":1}' -H 'content-type:application/json;' 'http://192.168.1.5:8080/jsonrpc'


The notification does not stay on the screen for 50 seconds... (I've set it this high for testing)...

I've got a separate Python call for a different Kodi automation, and that also doesn't follow the timing... So I'm sure its my error:

Code:
showAddedRequest='{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Just Added","message":"'+episodeMsg+'"},"displaytime":30000,"id":1}'



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2014-10-18

Yes, it seems to be ignoring the displaytime over HTTP (the notification is displayed for about 5 seconds, not 50 seconds), but the displaytime is being respected over RPC (my test last night was over RPC).


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2014-10-18

I was testing over HTTP and WebSockets and it worked fine with both. @Milhouse: RPC is not a transport so I guess you meant TCP Wink


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - edrikk - 2014-10-18

Hmmm... Weird.
So I'm reading that Milhouse you were able to reproduce, but Montellese you weren't?
Well, at least reading between the lines I guess my call is correct. But for sure Kodi isn't keeping the notification that long... Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2014-10-18

Yes, tcp Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2014-10-18

Well this is strange, the following curl request (based on what my script would use) over HTTP is working as expected:

Code:
curl --data-binary '{"jsonrpc": "2.0", "params": {"message": "message", "displaytime": 50000, "title": "title"}, "method": "GUI.ShowNotification", "id": "libNotification"}' -H 'content-type:application/json;' 'http://192.168.0.8:8080/jsonrpc'

but the following (based on @edrikk's command) is not:
Code:
curl --data-binary '{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Phone Call","message":"xxx"},"displaytime":50000,"id":1}' -H 'content-type:application/json;' 'http://192.168.0.8:8080/jsonrpc'

Edit: Aha, looks like @edrikk hasn't included "displaytime" in params{}


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2014-10-18

Yup just saw it as well. The "displaytime" property needs to be inside the "params" object and not outside of it. That explains it.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - edrikk - 2014-10-18

#%|t!!!

Banging head against a hard object...
As usual problem is between monitor and keyboard. ;(

Thank you guys so much!


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2014-11-05

@Montellese : In Kodi beta 1 (Don't know since when since I did not really check this) Input.SendText does not seems to work on text input in global dialogs.

For example in movie list view, go to filter, in the dialog position cursor to title: the send text does not fill the edit. Press enter to open the title dialog, now the send text does work.


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

(2014-11-05, 15:53)Tolriq Wrote: @Montellese : In Kodi beta 1 (Don't know since when since I did not really check this) Input.SendText does not seems to work on text input in global dialogs.

For example in movie list view, go to filter, in the dialog position cursor to title: the send text does not fill the edit. Press enter to open the title dialog, now the send text does work.

Thanks for the report. It's very odd as it works perfectly fine in the settings window for me.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - goundoulf - 2014-11-13

Code:
$ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["title", "album", "artist", "duration", "thuils"], "playerid": 0 }, "id": "AudioGetItem"}' http://192.168.1.16/jsonrpc

{"id":"AudioGetItem","jsonrpc":"2.0","result":{"item":{"album":"","artist":[],"duration":0,"fanart":"","file":"http://192.168.1.4:51613/GstLaunch/i/c3RyZWFtaW5n","label":"c3RyZWFtaW5n","thumbnail":"","title":"","type":"song"}}}

This command make Kodi play the UPNP stream sent from my PC.

However the title displayed is "c3RyZWFtaW5n", and there is no thumbnail. Is it possible to change the "label" and "thumbnail" displayed?

Thanks!


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - ASH_Macedo - 2014-11-26

I'm using Kodi beta 5 to test the json against a command fusion control that I'm creating and I'm having problems returning info from player.Getitem.

In Gotham i was able to return informations for the pvr like plot, label, genre and others. Now at leat in this latest beta this information is not returning. All that is returning is channel number, id and channel.

Maybe something broke for the pvr in the getitem part because this same information still returns correctly if the pvr.getboradcastdetails is called.

This is also only happening with pvr everything else is working fine.

Also is there a way to set timers for recordings from the json? If not that will be really good if implemented in the future.

Thanks,

Marcelo.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Lunatixz - 2014-11-26

::EDIT::
Nevermind Smile


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

(2014-11-26, 12:10)ASH_Macedo Wrote: I'm using Kodi beta 5 to test the json against a command fusion control that I'm creating and I'm having problems returning info from player.Getitem.

In Gotham i was able to return informations for the pvr like plot, label, genre and others. Now at leat in this latest beta this information is not returning. All that is returning is channel number, id and channel.

Maybe something broke for the pvr in the getitem part because this same information still returns correctly if the pvr.getboradcastdetails is called.

This is also only happening with pvr everything else is working fine.

Also is there a way to set timers for recordings from the json? If not that will be really good if implemented in the future.

Thanks,

Marcelo.

See https://github.com/xbmc/xbmc/pull/5843 for a fix. Thanks for the report.