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

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



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - doozer - 2012-11-19

I'm having a bit of brain failure... can anyone see what i'm doing wrong here?

Frodo nightly build from about 3 days ago.

Code:
{"jsonrpc": "2.0", "method": "AudioLibrary.GetArtistDetails", "params": {"artistid": 3,"properties": ["fanart", "description"]}, "id": "AudioLibrary.GetArtistDetails"}

Returns:
Code:
{"error":{"code":-32602,"message":"Invalid params."},"id":"AudioLibrary.GetArtistDetails","jsonrpc":"2.0"}

Thanks,
Matt.



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-11-19

It means that there's no artist with an ID 3.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-11-19

(2012-11-19, 01:22)VeeV Wrote: Ok, I think the same is happening with channel, channeltype, hidden, locked, endtime, channelnumber, tag, starttime. Might be worth double checking it.

Fixed in https://github.com/xbmc/xbmc/commit/d938545e61b86f334d66f87dcfb2920a95a63d93.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - VeeV - 2012-11-19

(2012-11-19, 09:49)Montellese Wrote:
(2012-11-19, 01:22)VeeV Wrote: Ok, I think the same is happening with channel, channeltype, hidden, locked, endtime, channelnumber, tag, starttime. Might be worth double checking it.

Fixed in https://github.com/xbmc/xbmc/commit/d938545e61b86f334d66f87dcfb2920a95a63d93.

We are missing "dateadded" too I think.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - doozer - 2012-11-20

(2012-11-19, 08:46)doozer Wrote: I'm having a bit of brain failure... can anyone see what i'm doing wrong here?

Frodo nightly build from about 3 days ago.

Code:
{"jsonrpc": "2.0", "method": "AudioLibrary.GetArtistDetails", "params": {"artistid": 3,"properties": ["fanart", "description"]}, "id": "AudioLibrary.GetArtistDetails"}

Returns:
Code:
{"error":{"code":-32602,"message":"Invalid params."},"id":"AudioLibrary.GetArtistDetails","jsonrpc":"2.0"}

Thanks,
Matt.

Hi Montellese,

Ok, so if artist 3 doesn't exist, I need to take a step back and show how i got the id:
Code:
{"jsonrpc": "2.0", "method": "Player.GetItem", "params": {"playerid": 0, "properties": ["title","artist","artistid","year","rating","albumartist","track","duration","genre","album","thumbnail","fanart"]}, "id": "Player.GetItem"}

As you can see, I'm requesting the artistid as one of the params.

The response i get is:
Code:
{"id":"Player.GetItem","jsonrpc":"2.0","result":{"item":{"album":"Greatest Hits","albumartist":[],"artist":["Eurythmics"],"duration":227,"fanart":"","genre":["Misc"],"id":3,"label":"Who's That Girl?","rating":0,"thumbnail":"image://DefaultAlbumCover.png/","title":"Who's That Girl?","track":3,"type":"song","year":1991}}}

If the "id":3 isn't the artistid, what is it, and how should I go about getting the currently playing artistid?

Thanks,
Matt.




RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - N3MIS15 - 2012-11-20

In that example 3 is the song id. See "type". To get the fanart and description you could use AudioLibrary.GetArtists and filter by artist


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - doozer - 2012-11-20

(2012-11-20, 07:09)N3MIS15 Wrote: In that example 3 is the song id. See "type". To get the fanart and description you could use AudioLibrary.GetArtists and filter by artist

Ok, but why is the artistid ignored in the request?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - N3MIS15 - 2012-11-20

(2012-11-20, 07:52)doozer Wrote:
(2012-11-20, 07:09)N3MIS15 Wrote: In that example 3 is the song id. See "type". To get the fanart and description you could use AudioLibrary.GetArtists and filter by artist

Ok, but why is the artistid ignored in the request?

Long story, but in essence because its possible to have more than 1 artist per song/album artistid is no longer returned.


Re: RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Martijn - 2012-11-20

(2012-11-20, 08:14)N3MIS15 Wrote:
(2012-11-20, 07:52)doozer Wrote:
(2012-11-20, 07:09)N3MIS15 Wrote: In that example 3 is the song id. See "type". To get the fanart and description you could use AudioLibrary.GetArtists and filter by artist

Ok, but why is the artistid ignored in the request?

Long story, but in essence because its possible to have more than 1 artist per song/album artistid is no longer returned.

We are discussing this and it may return.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Samtronic - 2012-11-20

Hi !

I switch to frodo yesterday and I try this command
{"jsonrpc": "2.0", "method": "audiolibrary.GetAlbums", "params": {"artistid": 3,"properties": ["thumbnail", "title", "fanart", "artist"] }, "id": 1}

and I receiceve code = -32602
data: {
..message = Too many parameters
..method = AudioLibrary.GetAlbums
..stack: {
....name = Item.Fields.Base
....property: {
......type = string
....}
....type = array
..}
}
message = Invalid params.

Thanks


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-11-20

Yeah all those filtering parameters like "artistid" and "genreid" have been moved into a "filter" parameter so you need to do
Code:
{"jsonrpc": "2.0", "method": "audiolibrary.GetAlbums", "params": {"properties": ["thumbnail", "title", "fanart", "artist"], "filter": { "artistid": 3 } }, "id": 1}



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Samtronic - 2012-11-20

Thanks for your help


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2012-11-20

Got a report today of a problem using JSON Files.GetDirectory with sources that targets upnp.

I quote here :
(2012-11-20, 20:15)ears Wrote: OK This is repeatable so I did it again with debug logging enabled.

Same behaviour - start up XBMC, go to UPnP server using keyboard, everything works fine. Can browse, opened up a stream, listened, stopped it.

At the turn of 18:07 I started using the Yatse tool. Immediately I could no longer browse the UPnP server.

Although interestingly I can browse any folder that I had previously accessed with the keyboard.

Then return to using the keyboard, and I can no longer browse any (non-cached?) UPnP folders, although I can still browse the one that I accessed at the start.

Paste Bin link to the log file - http://pastebin.com/kvrxnyTu

Thanks.

(2012-11-20, 22:06)ears Wrote: Yes.

Add the source (or use an existing one) after starting XBMC, using keyboard direct at XBMC, everything works fine.

Access the same source using Yatse, and I can't access any new folders that I didn't access already on the keyboard.

Go back to using the keyboard and it's still not working.

Close XBMC, start again and everything resets - works fine using keyboard until I access it using Yatse, then it breaks again.

Seems like Files.GetDirectory does not init something on Xbmc side.



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2012-11-22

Any idea about this ? Should I open a trac ticket but on witch category ?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-11-22

I'm trying to get my hands on alcoheca which has refactored the whole upnp code. Files.GetDirectory() simply calls CDirectory::GetDirectory() in XBMC which will pick whatever filesystem implementation is needed (in this case CPUPnPDirectory) and calls its GetDirectory() implementation.