XBMC Community Forum
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Development (/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (/forumdisplay.php?fid=174)
+---- Thread: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263)



albumartist - marksoccer - 2011-03-25 07:14

Is there any way to only get album artists rather than all artists? I know this can be done in XBMC GUI, but I can't figure out a way to do this through the current JSON implementation.


- carmenm - 2011-03-26 12:05

Montellese Wrote: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.
Yes i think i am going with this.
About fields:
- i really need new flags, especially watched and dateAdded. I know you can only code when you have free time, so i am willing to do it myself. Could you guide me on how to add a field to GetMovies function?

- it seems when looking at the code that "cast" should return the cast list for a movie, but i get a null value. is this normal?

Thanks for you great work. XBMC Json is really great.


- Montellese - 2011-03-26 13:49

You can get the watched status by using the "playcount" field which gives you even more information than simply watched/unwatched. DateAdded doesn't exist IMO and you'd have to extend the movie and episode database table for it.

Yes "cast" currently returns null but this will be fixed in the next version of json rpc. But getting the cast for every movie with GetMovies is very slow.


- wuench - 2011-03-26 15:38

carmenm Wrote: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

I have recently switched to using SendKey instead of raw actions via HTTP. I like it better as it preserves the sound effects and the keys are mapped via the keyboard.xml depending on the context (and are remappable by the end user). So if you use sendkey you can just send the OSD keycode.

I am also using System.GetInfoLabels, I use the ListItem.xxx labels to get info when a movie is not playing and the VideoPlaylist.GetItems when the videoplayer is active. GetInfoLablels is mostly blank when a movie is playing and unfortunately I think there is currently a bug and some of the info is not returned via the VideoPlaylist.GetItems labels (like Thumb). I haven't narrowed it down yet.

There is also System.GetInfoLabels VideoPlayer.xxx labels, I am not sure if/how well they work. If I remember right I couldn't get the thumbnail there either using VideoPlayer.Cover. All valid infolabels can be found here.

Code:
[b]SendKey command for OSD[/b]
http://xbox/xbmcCmds/xbmcHttp?command=SendKey(0xF00D)

[b]GetInfoLabels/VideoPlaylist.GetItems[/b]
{"jsonrpc":"2.0","method":"System.GetInfoLabels","params":["Listitem.Title","Listitem.Season","Listitem.Plot","Listitem.Duration"],"id":1}
{"jsonrpc":"2.0","method":"VideoPlaylist.GetItems","params":{"fields":["title","season","episode","plot","duration","showtitle"]},"id":1}



- carmenm - 2011-03-27 23:54

Thanks a lot for all those info.
I have a problem with the OSD SendKey command. It s not a show/hide key. The return first shows the osd then select the currently highlighted button.
What i would like is a show/hide command.
I know of softwares that does that. Do you know another keyboard shortcut to show/hide the osd?

Thanks


- wuench - 2011-03-28 15:45

I don't think there is an action for OSD toggle unless Action(83) does it.

I think normally you would send a ShowOSD and then a CloseDialog or something to close it. Two different actions, which you might be able to map to the same key in keyboard.xml under different contexts.


- carmenm - 2011-03-29 00:10

Actually i found a iphone application that does show/hide osd with a button. And it s not a button sending two differents key(at least i think) because if i show the osd using the mouse, the button hides it.
But maybe i can use JSON to know if the OSD is open? yet i didnt see any infoLabel that would do that

EDIT: got it! the solution was key 274! Sorry for being out of topic Confused


- carmenm - 2011-03-30 17:51

I am using http interface "GetCurrentlyPlaying" to get info on the currently plyaing object(easy and one call)
But i would like to use VideoLibrary.GetMovieDetails over the information i get from "GetCurrentlyPlaying".
My problem is that "GetCurrentlyPlaying" doesnt give me the movieid. I only get the filename. Is it possible to recover a movieid using its filename?

Thanks


- topfs2 - 2011-03-30 17:57

carmenm Wrote:I am using http interface "GetCurrentlyPlaying" to get info on the currently plyaing object(easy and one call)
But i would like to use VideoLibrary.GetMovieDetails over the information i get from "GetCurrentlyPlaying".
My problem is that "GetCurrentlyPlaying" doesnt give me the movieid. I only get the filename. Is it possible to recover a movieid using its filename?

Thanks

Nope. Don't think there ever will be, you really should not be using cross API calls, I'd suggest moving entirely Smile


- carmenm - 2011-03-30 19:11

Actually GetCurrentlyPlaying is the only function i use (except for SendKey)

Is there an example somewhere on how to get CurrentlyPlaying info through JSON?

Thanks


- Montellese - 2011-03-31 20:33

carmenm Wrote:Is there an example somewhere on how to get CurrentlyPlaying info through JSON?

First call "Player.GetActivePlayers" to determine the currently active player (audio, video or picture). If it is audio or video call Audio/VideoPlaylist.GetItems and read the "current" field to get the position of the currently playling item in the playlist. The "items" field contains an array of all items in the playlist and "items[current]" is the currently playing file. You can also tell jsonrpc which fields to return for every item in the playlist and therefore you'll have all the information you need.


- Kabooga - 2011-04-01 02:14

Looking through the repository (tip) I see there's an API for CAudioLibrary::GetGenres. Will this functionality be brought to Dharma?


- topfs2 - 2011-04-01 02:30

Kabooga Wrote:Looking through the repository (tip) I see there's an API for CAudioLibrary::GetGenres. Will this functionality be brought to Dharma?

We will not alter the API of an already stable release Smile


- Kabooga - 2011-04-01 04:12

Quote:Originally Posted by topfs2
We will not alter the API of an already stable release

That makes sense. Will that functionality be in release 11 then?


- topfs2 - 2011-04-01 04:21

Hard to say, as we haven't set a real date for eden just yet but so far extra announcements have gone in so that should be much more useful now.

Another really big one is the one Montellese have kindly been working on, which is full conformity with jsonrpc 2.0 spec and the all new Json Schema Descriptor, which makes the code more stable but also easier to understand from a client perspective. (Introspect explains everything you may want to know about the methods).