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.
Dear all,

Can anyone tell me what the syntax is to get just one setting in Kodi via JSON using Settings.SetSettingValue or
Settings.GetSettingValue?

I need to ask for "audiooutput.passthrough" specifically.
Any chance of a hint on what I am doing wrong here. I have searched the forum and had no luck.

From learning from the wiki I managed to build this simple code which works fine to switch "audiooutput.passthrough" on and off:

http://xxx.xxx.x.xx:8080/jsonrpc?request={"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.passthrough","value":true}, "id":1}

Now if anyone can tell me what the syntax is to just ask for what that setting is without changing it and get that as boolean feedback in the browser it would make my day. It is a little too deep for me to figure it out.
I am out of ideas to get settings. Grateful for any help.
Figured it out and answering my own question. I guess I was overcomplicating it.

If someone needs it it's here:
http://xxx.xxx.x.xx:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "Settings.GetSettingValue", "params": {"setting": "audiooutput.passthrough"}, "id": 1 }')

Returns boolean:
{"id":1,"jsonrpc":"2.0","result":{"value":true}}
or
{"id":1,"jsonrpc":"2.0","result":{"value":false}}

Works for any setting so far I've tried.
@Montellese :

Never tested before but {"jsonrpc":"2.0","id":1,"method":"VideoLibrary.GetTVShows","params":{"properties":["season","episode","watchedepisodes"]}}

Will always return -1 for season while it should return the number of season if I understand the purpose of the field.
Is there a JSON command that allows you to remove USB disks safely?
I found this in the ControlSystem category:
5.11.1 System.EjectOpticalDrive
Ejects or closes the optical disc drive (if available)
Permissions:
ControlSystem

But nothing for disks generally.
Would this be possible?
TIA
(2015-03-11, 13:26)Tolriq Wrote: [ -> ]AudioLibrary.GetArtists :
- Without albumartistsonly or set to false : Return all artists but not "Various Artists"
- With albumartistsonly set to true : Return "Various Artists" but not the compilation artists.

In both cases : The field compilationartist is always false when it should be set to true for compilation artists in the first case.

Fixing the "Various Artists" issue will be difficult because it is pretty much broken on the music database level. Especially the fact that we create an artist with the translated string of "Various Artists" which will be unusable after having changed the GUI language is very troublesome.

Concerning the "compilationartist" property I checked the code and its commit history and it actually looks like you introduced the "compilationartist" property in 16767de3dad0654db94eef04732d9e4f21bd04e9 but according to fb639c56b84ad97e0f7fead86e2a46dcf17f207c, which introduced the compilation flag, it is only valid for albums. So that should probably be changed to a "compilation" property for albums and change the condition on the "compilationartist" property to something that makes more sense.
Well I guess one of my first commit when I was still hoping Wink

The source post http://forum.kodi.tv/showthread.php?tid=154377 already talked about the need, seems I miss read the code at this time and should have asked for more help.

Anyway after reading https://github.com/xbmc/xbmc/blob/master....cpp#L5598 it seems it will be near impossible to simply add this missing field, meaning the logic have to be handled at application level to reproduce the different queries, complicated queries not optimal at all on low end devices Sad
@Montellese : Was reported a few times, but it seems more and more users are using smart playlist as they expand their capabilities.

When using player.open on smartplaylist the random order setting of the smart playlist is not respected, it's always played in default order and it seems most users use this for random music of some kind Sad
(2014-11-30, 12:57)ASH_Macedo Wrote: [ -> ]Montellese,

Just tested and it is working perfectly now. Thanks for your time.

If in the future you have some time to add a possibility to record the pvr from broadcastid or to set timers for future programs it will be awesome.

Regards,

Marcelo.

I've just submitted a pull request for this functionality to add a timer via the json-rpc interface based on the broadcastId. I've tested it on my pi and it seems to work fine. Hopefully that'll appear in the main repo at some point (it's my first pull request into the main repo... so I'm not sure how it will go!)

Steve.
Thx
Hopefully some of the knowledgeable devs will review it.
Hi All,

Where can I find the JSON-RPC docs for the "Profiles" namespace?

Couldn't see anything here:
http://kodi.wiki/view/JSON-RPC_API/v6

Thanks in advance.

Matt.
(2015-06-17, 12:49)doozer Wrote: [ -> ]Hi All,

Where can I find the JSON-RPC docs for the "Profiles" namespace?

Couldn't see anything here:
http://kodi.wiki/view/JSON-RPC_API/v6

Thanks in advance.

Matt.

Can get the schema from introspect.
Hi. Is it possible to change values from advancedsettings.xml via JSON-RPC?

I'd like to dynamically set/get the <latency> <delay> value from here http://kodi.wiki/view/Advancedsettings.xml#video

Code:
<latency> <!-- Compensate display latency (video lag). Latency is given in msecs. -->

    <delay>0</delay> <!-- Global default display latency -->

    <!-- Override latency for given display (not video) refresh rates. When Kodi is in windowed mode, override is ignored. Multiple overrides are allowed.

     Syntax of an override entry:
       <refresh>
         <min>, <max> refresh rate range, OR
         <rate> exact refresh rate
         <delay> display latency for the given refresh rate
       </refresh>
    -->

    <!-- Example: display has 125 msec latency at 23-24 Hz -->
    <refresh>
      <min>23</min>
      <max>24</max>
      <delay>125</delay>
    </refresh>

    <!-- Example: display has 50 msec latency at 50 (+/-0.01) Hz -->
    <refresh>
      <rate>50</rate>
      <delay>50</delay>
    </refresh>

  </latency>

I've been trying to get as much info as I could using JSON.Introspect and seeking settings.xml, but I'm stuck.

Any ideas? Thanks in advance.
No not possible
(2014-03-30, 21:47)Montellese Wrote: [ -> ]
(2014-03-30, 21:09)wuench Wrote: [ -> ]What property values will trigger a Player.OnPropertyChanged notification? The JSONRPC documentation lists a lot of properties like time, percentage, etc. But I don't see any OnPropertyChanged notifications coming in at all so I assume it can't return those values....

Right now only "shuffled" and "repeat" AFAICT. The others are properties you can retrieve through Player.GetProperties.


Is this still valid?
Understand triggering a notification on everything that is in PlayerProperty.Value (especially the time/percentage values) would be busy to say the least, but event driven code for things other than shuffle and repeat would be nice...
So before I go and reinvent the wheel has anybody produced a now playing solution that can be displayed on a php page?