• 1
  • 110
  • 111
  • 112(current)
  • 113
  • 114
  • 226
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC
Montellese Wrote:I just tested this with several different albums and several different positions in the playlist (i.e. different tacks) and using your request I always get the expected result. All returned properties (except "albumartist" which was empty) contained the expected value.

Thanks for testing it. I'll triple check my data and try again.
Reply
+1 on the added date (I think that goes for quite a lot of people Smile). I'm quite surprised there isn't a date added field in the DB already.

I'm looking at movie sets and have two questions:

1. Sort is listed in introspect for details but I get "too many params" when I try.

Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovieSetDetails", "params": {"setid": 1, "properties": [ "fanart", "playcount", "thumbnail"], "sort": { "order": "ascending", "method": "label" } },"id": 1 }

2. Can I choose what properties are returned for each movie in a movie set? Atm only the movieid and label is returned. I really would like the thumbnail as well so I can just pipe it "as is" to a movie view.

Thanks.
Image
AWXi - Ajax web interface. Wiki
Reply
You're reading the introspect wrong. VideoLibrary.GetMovieSetDetails takes a parameter named "movies" which in turn takes properties named "sort", "properties" and "limits". So generally you get the same stuff in the "movies" parameter you also get in the VideoLibrary.GetMovies method. That should answer both of your questions Wink
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
Blush Thanks.

For anyone else who does the same here is an example:
Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovieSetDetails", "params": {"setid": 1, "properties": [ "fanart", "playcount", "thumbnail"], "movies": { "properties": [ "thumbnail" ], "sort": { "order": "ascending", "method": "sorttitle" }} },"id": 1 }
Image
AWXi - Ajax web interface. Wiki
Reply
A little question about old http api command SendKey.

It seems this command is the only way to send keys on dialogs in Xbmc like search or such things. Sendings keys via eventclient does not work. (Or perhaps i didn't find the way).

Is this function planned after eden ?
Reply
What keys are you exactly talking about? Character keys or generally any kind of key?

I got no clue about the eventserver/client and what it supports but I thought it could take almost any key as an input (using the correct key code).

In general we/I don't want to provide methods in JSON-RPC where we don't have the slightest chance of validating the input but I may have found a way around that (for keys and other stuff). I will have to discuss that method in the team though once Eden has been released.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
Character keys.

I can send with eventclient correct keycodes but that will always trigger the attached functions in keymap, for example if i send the "c" key then the context menu appears, but when a dialog appears with the virtual keyboard then if i send the same "c" it does nothing.

Seems there's no way to beside httpapi sendkey to populate the text fields when the virtualkeyboard is shown.
Since some peoples asked me to add this in my app, it's quite bad to use the deprecated http api just for this .... (not talking about threadings & co to have the chars in correct order quite a job for a such simple thing :p )
Reply
Ok so after a little more investigation, seems like a little bug that maybe corrected for Eden (well i hope :p)

This is not the good thread to post but since i know you read here often i try here.

When i send a key from eventclient in logs we got :
Quote:DEBUG: CApplication::OnKey: d (f044) pressed, trying keyboard action 61440

When using real keyboard we got :
Quote:DEBUG: CApplication::OnKey: d (f044) pressed, trying keyboard action 61793

The only difference is that the flag KEY_ASCII (and KEY_UNICODE on unicode keys) is not set, and that's make all the difference.

In xbmc code there's a lot of special things about real keyboard or httpapi, but nothing for event client.

The main problem seems related to (Application.cpp) in OnKey:
Code:
if (key.GetUnicode())
            action = CAction(key.GetAscii() | KEY_ASCII, key.GetUnicode());
          else
            action = CAction(key.GetVKey() | KEY_VKEY);

With a root cause in (guiilib/Key.cpp) :
Code:
CKey::CKey(uint8_t vkey, wchar_t unicode, char ascii, uint32_t modifiers, unsigned int held)
{
  Reset();
  if (vkey) // FIXME: This needs cleaning up - should we always use the unicode key where available?
    m_buttonCode = vkey | KEY_VKEY;
  else
    m_buttonCode = KEY_UNICODE;

With the httpapi having a special treatment :

Code:
void CKey::SetFromHttpApi(bool bFromHttpApi)
{
  if(bFromHttpApi && (m_buttonCode & KEY_ASCII) )
  {
      m_unicode = m_buttonCode - KEY_ASCII;
  }
    
  m_fromHttpApi = bFromHttpApi;
}
that set the unicode part.

I don't know what's the solution, but since to send real keyboard char we need to set the VKEY flag but after that it seems that when coming from event client we don't detect ascii / unicode chars, this can not work. But since there's a big FIXME on the part that seems to be problematic, i'm sure someone have the answer.
Reply
Thanks for investigating. Like I said my knowledge about the EventServer/EventClient is almost zero and I'll have to ask more knowledgeable people whether this behaviour is by design or if it's messed up. I assume you try to use this in your yatse widget for android. Could you provide me (over PM) with a test app which allows me to send all the common ASCII/Unicode keys on a keyboard to XBMC so I can try it out myself?
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
PM sent, I really hope that this is a simple bug that can be corrected for Eden, this would allow Remote Devs to totally drop HttpApi.
Reply
Hello.

Is there a way to get movies from a smart playlist ? For now, I use VideoLibrary.GetMovies and I parse XSP smart playlist and check for every movie if all conditions listed in XSP are meeted or not.

I have try Playlist.GetPlaylists but the result is :

[{u'playlistid': 0, u'type': u'audio'}, {u'playlistid': 1, u'type': u'video'}, {u'playlistid': 2, u'type': u'picture'}]

I was expecting a list containing my smart playlist defined to classifie my movies (Films, Animated, ...) in order to use Playlist.GetItems.

Am I wrong ?

Thanks.
Sorry for my english, but, you know, I'm French so ...

Main HTPC : Odroid-C2 running CoreELEC with Titan Bingie
Secondary HTPC : Freebox Mini 4K running Android TV with Titan Bingie
Reply
I too rely on SendKey in my CQC driver. I use the Eventserver for that and few actions still unsupported.

I think Boxee may have a better solution for filling in dialogs. They added a TextFieldSet command to allow you to send strings to fill in dialogs to their JSONRPC command set. That is a little easier to deal with than sending individual keys. You may be able to detect when in a text field or dialog via info used for GetInfoLabels. I noticed sometimes it will say dialog in currentwindow or currentcontrol...
Reply
Adding this and standard remote functions to Json will be cool (and i hope done :p ) but never for Eden, whereas with a little chance the event server can be corrected for Eden Smile
Reply
Standard remote functions are already there in JSON. Up/down/left/right/select/back. And match what boxee has.

I am hoping one day the stars align and boxee and xbmc's JSON protocols align so I can stop supporting two sets of code... I think that is mostly on boxee though...
Reply
mikebzh44 Wrote:Hello.

Is there a way to get movies from a smart playlist ? For now, I use VideoLibrary.GetMovies and I parse XSP smart playlist and check for every movie if all conditions listed in XSP are meeted or not.

I have try Playlist.GetPlaylists but the result is :

[{u'playlistid': 0, u'type': u'audio'}, {u'playlistid': 1, u'type': u'video'}, {u'playlistid': 2, u'type': u'picture'}]

I was expecting a list containing my smart playlist defined to classifie my movies (Films, Animated, ...) in order to use Playlist.GetItems.

Am I wrong ?

Thanks.
The playlist namespace is meant to only handle xbmc internal playlists which are meant to directly play items. SmartPlaylists are xbmc internal playlists but once you start playing one what XBMC does it copy all its items to a playable playlist. In the future there will probably be something like VideoLibrary.GetPlaylists and AudioLibrary.GetPlaylists to retrieve those playlists. If you want to retrieve the content of a smartplaylist you can use Files.GetDirectory by providing the path to the XSP file in the "directory" parameter.

wuench Wrote:I too rely on SendKey in my CQC driver. I use the Eventserver for that and few actions still unsupported.

I think Boxee may have a better solution for filling in dialogs. They added a TextFieldSet command to allow you to send strings to fill in dialogs to their JSONRPC command set. That is a little easier to deal with than sending individual keys. You may be able to detect when in a text field or dialog via info used for GetInfoLabels. I noticed sometimes it will say dialog in currentwindow or currentcontrol...
I don't think that something like TextFieldSet is a nice solution because it highly depends on a certain context and only works therein. Furthermore we discourage the use of GetInfoLabels.

Tolriq Wrote:Adding this and standard remote functions to Json will be cool (and i hope done :p ) but never for Eden, whereas with a little chance the event server can be corrected for Eden Smile
IF it is a bug and not done this way by design.

wuench Wrote:Standard remote functions are already there in JSON. Up/down/left/right/select/back. And match what boxee has.

I am hoping one day the stars align and boxee and xbmc's JSON protocols align so I can stop supporting two sets of code... I think that is mostly on boxee though...
Boxee's API is based on a rather old version of XBMC's JSON-RPC API (I never checked myself but someone once reported that it's pre-Dharma) and they just added some custom methods on top of it.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
  • 1
  • 110
  • 111
  • 112(current)
  • 113
  • 114
  • 226

Logout Mark Read Team Forum Stats Members Help
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC8