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.
Montellese, I have another question. Lets say for instance that I want to have a command take me directly to the Title screen of movies in the video library.....

I've tried this command, but it doesn't work

{"jsonrpc": "2.0", "method": "GUI.ActivateWindow", "params": { "window": "videolibrary", "parameters": [ "movies" , "title"] }, "id": 1 }

I think I'm messing up the parameters format. Thanks in advance for any help you can provide.
For the parameters have a look at
http://wiki.xbmc.org/index.php?title=Ope...nd_Dialogs
and
Chapter 11 Apendix I: List of Windows in http://wiki.xbmc.org/index.php?title=XBM...ing_Manual
Previously I was using the HTTP interface to access JSON and the EventServer. For Frodo I have now switched to the socket interface, but I am having a lot of problems with users not understanding how to enable access. Previous versions of XBMC had all the access I needed enabled by default in their builds.

Is it possible to have the Enable External Access enabled by default?

I don't see why that would be disabled, when HTTP and EventServer are enabled by default. I mean if I can go in via HTTP an use JSON by default why would using the socket interface be considered any less secure....
Http and Eventserver are disabled by default Smile only some all integrated distributions like old openelecs have them activated but this is bad Smile
(2013-01-11, 08:36)johnsills1 Wrote: [ -> ]Montellese, I have another question. Lets say for instance that I want to have a command take me directly to the Title screen of movies in the video library.....

I've tried this command, but it doesn't work

{"jsonrpc": "2.0", "method": "GUI.ActivateWindow", "params": { "window": "videolibrary", "parameters": [ "movies" , "title"] }, "id": 1 }

I think I'm messing up the parameters format. Thanks in advance for any help you can provide.

I did it like this
{"jsonrpc": "2.0", "method": "GUI.ActivateWindow", "params": { "window": "videolibrary", "parameters": [ "MovieTitles" ] }, "id": 1 }
I have another idea that I would like to be able to do.....

Can I add a 'parameters' field to
{"jsonrpc": "2.0", "method": "GUI.ActivateWindow", "params": { "window": "musiclibrary", "parameters": [ "playlists" ] }, "id": 1 }

that will take me to a specific playlist and start playing the playlist automatically?

I tried this but it didn't work
{"jsonrpc": "2.0", "method": "GUI.ActivateWindow", "params": { "window": "musiclibrary", "parameters": [ "playlists" , "John's 4 Stars" ] }, "id": 1 }

I have several playlists for different individuals in the house. Instead of having to look at the TV Screen and browse to the playlist that I want to listen to, I could just send a command that automatically plays whatever playlist I want.
Please use code tags. I handle playlists in AWXi if you want to take a look. Basically use GetDirectory.
Montellesse, I've found a potential bug in XBMC......

When I am playing music and I have the screen up that shows Artist artwork (refreshing with a different image every few seconds) then I hit the "TAB" button which changes the screen to a different look and then "TAB" again, everything works fine

As soon as the artist changes when the next song plays, the Artist artwork doesn't refresh to the new artist, it continues to display the first artist, no matter how many songs play through, the original artist artwork remains (refreshing with a different image every few seconds like it's supposed to, just the wrong artist)

I hope that made sense.

If you need a logfile, just let me know
(2013-01-12, 19:05)Mizaki Wrote: [ -> ]Please use code tags. I handle playlists in AWXi if you want to take a look. Basically use GetDirectory.

I'm not sure what you mean by use code tags..... Any help is appreciated.
Code tags as code tags in bbcode to correctly post in this forum so other users can read Smile

@Montellese : I'm trying to find up to date data on which fields does trigger additional database query to set a minimal one for faster sync but I'm not sure where to get the data.

For movies for example :
The introspect tells some fields (cast, showlink and/or tag field)
The C code seems to add also streamdetails

And if I remember well I think resume and now thumbnail now slows down the query too. (I have doubt about sets since it's now a 1/1 relation I suppose it's no more the case).

So if you can confirm the fields or the way to identify them.

Thanks
@johnsills1: code tags are [ code ] and [/ code ] around your code parts (without the spaces).

@Tolriq: Yup that info might not be up to date because I changed it a while ago. Here's the list:

movies: cast, showlink, tag, streamdetails, art, thumbnail, fanart
tvshows: cast, tag, art, thumbnail, fanart
episodes: cast, streamdetails, art, thumbnail, fanart
musicvideos: tag, streamdetails

You're correct on sets, they are a 1:1 relation now so they can be retrieved directly.
Thanks Smile

Stupid question but is there any speed difference for asking art or just thumbnail ?
I'm not 100% sure because the artwork caching etc is jmarshall's playground. Generally retrieving only thumbnail is probably a bit faster than retrieving artwork but if you e.g. plan to retrieve thumbnail and fanart you might be faster by just retrieving "art" which contains both thumbnail and fanart.
Thanks will make some tries Smile

But I must admit that now that I have received my rpi all the Json / Database is just horrible on this little thing :p