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.
(2013-01-19, 16:50)Mizaki Wrote: [ -> ]You are mixing your filters in a way not supported.

Code:
{"jsonrpc": "2.0", "id": 1, "method": "audioLibrary.Getalbums", "params": { "sort": { "order": "ascending", "method": "album", "ignorearticle": true }, "properties": ["artist", "genre", "rating", "thumbnail", "year", "mood", "style"], "filter":  { "and": [ {"field": "albumartist", "operator": "is", "value": "future of the left"}, {"field": "album", "operator": "is", "value": "curses"} ] } } }

Something like that you are trying to do? Artist is "future of the left" AND album is "curses"?

Little pimp here. If you want an easy way to get advanced search use AWXi advanced search and capture the command in debug. As I did for the above.

Thanks for the help, and the info on AWXi.

Code:
wget -q -O/dev/null --header='Content-Type: application/json' --post-data='{"jsonrpc": "2.0", "method": "Player.PlayPause", "params": { "playerid": 0 }, "id": 1}' http://192.168.1.101:2222/jsonrpc
this works on linux mint but on android it returns: wget: server returned error: HTTP/1.1 415 Unsupported Media Type

anyone know a way to fix this
Hi Montellese,

Is there a chance you could add a JSON call to "increase/decrease volume by X"? where X is a value between 1 and 100? And (maybe to reduce load from server, an optional "do this Y times" parameter which defaults to 1 if not set).

Reason:

Currently the set volume calls require a value to set to. For example 98. This means that a call has to be made to obtain the current volume, then add / subtract the required amount, then resubmit the new value using "set."

This is cumbersome when using one way HTTP to post to the server. Additionally in scenarios such as EvenGhost scripts, a lot of senseless load (even if small) is placed on the server to repeatedly , ask the server "what's the volume" then increase by "X" each time the user presses the "up" or "down" key.


With my proposal:
The server knows that the volume has to be increased "X" from the current value. It checks the boundaries even if the user goes beyond by constant calls and does nothing. ESPECIALLY if the optional parameter is supported. The user simply says "lower by 10", and if the volume is 4, then it can simply set to 0 (instead of 4 calls of lower by 1 from user being respected, and 6 calls being 'wasted').

Love to hear your thoughts on this...
I think there is a increment/decrement option for setVolume.
Code:
"{\"jsonrpc\":\"2.0\",\"method\":\"Application.SetVolume\",\"params\":{\"volume\":\"increment\"},\"id\":1}"
seems to be accepted and the volume increases by 1.

The problem is the delta for increment/decrement seems to be only 1.
Hmmm... great! I'll try that later tonight when I get home. It'll be a little cumbersome on a remote (each click of volume button changing by one) but will have to try to see if that's just an in my head (i.e. not being there at the tv to see it in action) issue or not... Smile

It would be great if one could tell it to 'do this Y times' to create bump up/down the volume in increments of (say) 10 in a nice 'fading' way...

Hi,
What is the best way to play all files in a directory ? at the same time i want to insert this files in a playlist, its possible ?
I tried this for insert all items in a playlist:
{"jsonrpc":"2.0","method":"Playlist.Add","params":{ "playlistid":1, "item": {"directory":"Z:/Downloads/00 VideoClips/"}},"id":1}
Don work for me, i am doing some thing wrong.
Thanks for the help
Clayton
Ops, my bad, its working very nice now.
It appears that the runtime field isn't returning the exact value for videos. It is very close, but appears to be rounded. For example, I see that The Usual Suspects is 6364 seconds long, based on playing the video as well as my own parsing of the video file. Using the Files.GetDirectory call with a smart playlist as the directory argument, the runtime for the video is returned as 6360. I also see many of my tv video files returned as 1800 seconds when they actually vary quite a bit.
(2013-01-28, 01:40)Jason102 Wrote: [ -> ]It appears that the runtime field isn't returning the exact value for videos. It is very close, but appears to be rounded. For example, I see that The Usual Suspects is 6364 seconds long, based on playing the video as well as my own parsing of the video file. Using the Files.GetDirectory call with a smart playlist as the directory argument, the runtime for the video is returned as 6360. I also see many of my tv video files returned as 1800 seconds when they actually vary quite a bit.

The runtime values are a bit complicated. Depending on whether you have listed them in the GUI or not you either get a value retrieved by a scraper (most likely in minutes) and then converted into seconds by XBMC or you should get the exact runtime in seconds as extracted from the video file.
In your example (1800 and 6360) it looks like those are values retrieved by a scraper in minutes and then converted into seconds.
Hi,
I stumbled upon the following result when querying properties from a video without an audio stream:
Code:
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "audiostreams": [

        ],
        "currentaudiostream": {
            "bitrate": 0,
            "channels": -1,
            "codec": ""
        },
        "currentsubtitle": {

        },
        "subtitleenabled": true,
        "subtitles": [

        ]
    }

The query is:
Code:
{"jsonrpc": "2.0", "method": "Player.GetProperties", "params":{ "properties": ["currentaudiostream", "audiostreams", "subtitleenabled", "currentsubtitle", "subtitles" ], "playerid": 1 },"id": 1}

Is there a reason that currentaudiostream is not empty? I think it is inconsistent w.r.t. currentsubtitle, for example.
Ok so now that Frodo is out have you decided the final way to make the Feature Requests for Frodo and acceptation system ?

Since next release is far away I think I'll propose more patch to help going further for what I can but will still need some pointers and best practices correction at start I guess Smile
Frodo 12.0 stable:

Via the keyboard you can hit the 'i' key and it will toggle the playback info on screen (for example the movie name and playback position etc).

Is there a way via the JSONv6 API to do the same thing?

Sending a GUI.ActivateWindow with the param 'videoosd' displays the overlay, but there is no way to remotely cancel it. Which results in any further commands being queued until you use the keyboard/mouse directly on the XBMC machine.

Anyone managed to get this working?

Thanks,
Matt.
(2013-01-28, 19:42)ace20022 Wrote: [ -> ]Hi,
I stumbled upon the following result when querying properties from a video without an audio stream:
Code:
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "audiostreams": [

        ],
        "currentaudiostream": {
            "bitrate": 0,
            "channels": -1,
            "codec": ""
        },
        "currentsubtitle": {

        },
        "subtitleenabled": true,
        "subtitles": [

        ]
    }

The query is:
Code:
{"jsonrpc": "2.0", "method": "Player.GetProperties", "params":{ "properties": ["currentaudiostream", "audiostreams", "subtitleenabled", "currentsubtitle", "subtitles" ], "playerid": 1 },"id": 1}

Is there a reason that currentaudiostream is not empty? I think it is inconsistent w.r.t. currentsubtitle, for example.
Not sure, will have to look into it. I probably wrote the code with the assumption that there will always be an audio stream but not that there will always be a subtitle stream.

(2013-01-30, 19:30)Tolriq Wrote: [ -> ]Ok so now that Frodo is out have you decided the final way to make the Feature Requests for Frodo and acceptation system ?

Since next release is far away I think I'll propose more patch to help going further for what I can but will still need some pointers and best practices correction at start I guess Smile
Not sure I follow. You can post feature requests here in the JSON-RPC subforum as new threads where they can be discussed. For code submission/patches obvioulsy github PRs is the preferred way.

(2013-01-31, 05:54)doozer Wrote: [ -> ]Frodo 12.0 stable:

Via the keyboard you can hit the 'i' key and it will toggle the playback info on screen (for example the movie name and playback position etc).

Is there a way via the JSONv6 API to do the same thing?

Sending a GUI.ActivateWindow with the param 'videoosd' displays the overlay, but there is no way to remotely cancel it. Which results in any further commands being queued until you use the keyboard/mouse directly on the XBMC machine.

Anyone managed to get this working?

Thanks,
Matt.
Yeah this works with the keyboard because of the keymappings in keyboard.xml but IMO executing the "info" action (or whatever it's called) should lead to closing the info overlay if it's already open. Have you tried the "backspace" action to close the OSD / info overlay?
I was talking about the old discution in another thread about using trac or github as feature request tracker Smile

For PR of course it will be github I was more talking about the GO / NO GO on feature that I can handle or not to not do work for nothing and hints about where to start for FR about specific featuresSmile
Just create a new thread for every feature you can think of in the JSON-RPC subforum and we can discuss them there.