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 - N3MIS15 - 2012-10-26

if u remove image:// then urlencode and then add image:// back it should work.


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

You're still doing it wrong in your first approach. Have you ever tried to view the image in your webbrowser using the image:// path? From JSON-RPC you get
Code:
image://<url-encode(path)>
which you then need to URL-encode to
Code:
<url-encode(image://<url-encode(path)>)>
which you then need to pass to the webserver
Code:
http://192.168.1.5:8080/image/<url-encode(image://<url-encode(path)>)>

I'm actually wondering how your second approach works and I still don't understand why you pass a webserver-URL as an image path. XBMC should be able to directly access the image without having to go through its own webserver. If you are dead set on using a webserver-based URL I'd recommend to first try to figure out the proper URL using your browser and then using whatever URL you've come up with in your JSON-RPC request.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - bradvido88 - 2012-10-29

Is there any way to refresh the current listing in the GUI? I've recently switched to Frodo and used to use the HTTP API to do this.

From the documentation, I can't see any way to do this with JSON-RPC. Any tips or is this a feature request?


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

Unless there's an action for it (which I don't think there is), there's no way to do this. So you'd have to make a feature request in this sub-forum for it. What exactly do you need it for? XBMC should refresh library views when new items are available etc.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - bradvido88 - 2012-10-29

(2012-10-29, 18:57)Montellese Wrote: Unless there's an action for it (which I don't think there is), there's no way to do this. So you'd have to make a feature request in this sub-forum for it. What exactly do you need it for? XBMC should refresh library views when new items are available etc.

I need it because I have a program that automatically marks all identical episodes (based on season/episode number) for a series as "watched" when any one of them is watched. This is done by setting the playcount to 1 for all of them.

Then I refresh the GUI (previusly with HTTP ExecBuiltIn(Container.Refresh)), and all episodes with the same season/episode number get a check mark. If I don't refresh the gui, they don't get the check mark unless i navigate back/forward.

(On a side note, the reason I do this is because I have multiple identical episodes from different sources (e.g. hulu, pvr, netflix) in my library, and i want them all the be marked as watched when any one is watched).





RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Martijn - 2012-10-29

(2012-10-29, 19:08)bradvido88 Wrote:
(2012-10-29, 18:57)Montellese Wrote: Unless there's an action for it (which I don't think there is), there's no way to do this. So you'd have to make a feature request in this sub-forum for it. What exactly do you need it for? XBMC should refresh library views when new items are available etc.

I need it because I have a program that automatically marks all identical episodes (based on season/episode number) for a series as "watched" when any one of them is watched. This is done by setting the playcount to 1 for all of them.

Then I refresh the GUI (previusly with HTTP ExecBuiltIn(Container.Refresh)), and all episodes with the same season/episode number get a check mark. If I don't refresh the gui, they don't get the check mark unless i navigate back/forward.

(On a side note, the reason I do this is because I have multiple identical episodes from different sources (e.g. hulu, pvr, netflix) in my library, and i want them all the be marked as watched when any one is watched).
What do you use for updating playcount? if you use the JSON-RPC commands it should update auto i think




RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - bradvido88 - 2012-10-29

(2012-10-29, 19:16)Martijn Wrote:
(2012-10-29, 19:08)bradvido88 Wrote:
(2012-10-29, 18:57)Montellese Wrote: Unless there's an action for it (which I don't think there is), there's no way to do this. So you'd have to make a feature request in this sub-forum for it. What exactly do you need it for? XBMC should refresh library views when new items are available etc.

I need it because I have a program that automatically marks all identical episodes (based on season/episode number) for a series as "watched" when any one of them is watched. This is done by setting the playcount to 1 for all of them.

Then I refresh the GUI (previusly with HTTP ExecBuiltIn(Container.Refresh)), and all episodes with the same season/episode number get a check mark. If I don't refresh the gui, they don't get the check mark unless i navigate back/forward.

(On a side note, the reason I do this is because I have multiple identical episodes from different sources (e.g. hulu, pvr, netflix) in my library, and i want them all the be marked as watched when any one is watched).
What do you use for updating playcount? if you use the JSON-RPC commands it should update auto i think
Currently it's a direct db update. I'm moving it to use JSON-RPC though.
That would be great if it did update the GUI, but I'd be surprised. I'll report back once I have it working.




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

Then get ready to be surprised as I have actually fixed this a while ago, see http://trac.xbmc.org/ticket/13173.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - bradvido88 - 2012-10-29

Smile The JSON-RPC API is sure growing up


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Millencolin007 - 2012-10-29

(2012-10-29, 22:11)Montellese Wrote: Then get ready to be surprised as I have actually fixed this a while ago, see http://trac.xbmc.org/ticket/13173.

I just verified that the playcount changes if you mark a movie as watched;-) Thanks for fixing this

But if you change the song rating for the currently playing song the OSD still does not show the updated rating. It only shows the new rating when you play the song for the next time.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - dudio - 2012-10-31

Hi,

I'm building a client application using the JSON-RPC API. On Dharma & Eden I could start the addon using the HTTP-command:
Code:
ExecBuiltin(RunScript(script.xbmc.subtitles))
Works flawlessly.

But now I'm trying to get the application on par with pre-Frodo. From the documentation I think this should do the trick:
Code:
{ "jsonrpc":"2.0", "id":351, "method":"Addons.ExecuteAddon", "params": {"addonid":"script.xbmc.subtitles"} }

But no luck, sadly. Can someone confirm my assumption that this is the JSON call I should use? Or will this not work with Frodo yet?



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

I fixed it yesterday or two days ago. Get the recent nightly build and you should be good to go.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - dudio - 2012-10-31

Thanks! Confirmed it on OSX. The latest Windows nightly is a couple of days old, but I'm sure it'll work there as well (I hope so actually Smile)


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

How would I get the library id of a file if I only know its path? For example, I know the video smb://share/mymovie.mkv is in the library and I want to know its movieid.

I've been playing with Files.GetFileDetails but can't seem to find a way to return the info I want. On that note, is there a special parameter i can send that says to return ALL fields as opposed to listing the ones i want individually?


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

You'll have to specify every property you want manually.
Files.GetFileDetails should do what you want as long as you provide the path used by XBMC plus you need to provide the "media" parameter to tell JSON-RPC in which library to look (in the case of a movie you have to pass "media": "video").