Talk:JSON-RPC API: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Divol
>Divol
Line 41: Line 41:


</pre>
</pre>
Ticket URL: <http://trac.xbmc.org/ticket/11275#comment:3>


== AudioLibrary.getAlbums with params {"jsonrpc":"2.0","method":"AudioLibrary.GetAlbums","params":{"genreid": -1 ,"artistid": -1 ,"start": -1,"end": -1 }, "id":"AudioLibraryGetAlbums"} ==
== AudioLibrary.getAlbums with params {"jsonrpc":"2.0","method":"AudioLibrary.GetAlbums","params":{"genreid": -1 ,"artistid": -1 ,"start": -1,"end": -1 }, "id":"AudioLibraryGetAlbums"} ==

Revision as of 14:38, 3 March 2011

-- Hints --

  • First : have a look to json RPC 2.0, it's not a joke, you'll win much time ! ( the "id", the "id" ...!)
    • yes, the /jsonrpc is mandatory (see xbmc code source ....)
  • the POST message could be :

{"jsonrpc":"2.0","method":"JSONRPC.Introspect","id":"introspect"}

--Divol 17:14, 24 February 2011 (UTC)

patch to be done CAudioLibrary::GetAlbums

ok, i know there's a place to note bugs. I am using this page as scrapbook...


JSON_STATUS CAudioLibrary::GetAlbums(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result) { if (!(parameterObject.isObject() || parameterObject.isNull())) return InvalidParams;

const Value param = ForceObject(parameterObject);


 if (!(ParameterIntOrNull(param, "artistid") || ParameterIntOrNull(param, "albumid")));

to be replaced by

 

if (!(ParameterIntOrNull(param, "artistid") || ParameterIntOrNull(param, "genreid"))) //jd:

 


Ticket URL: <http://trac.xbmc.org/ticket/11275#comment:3>

AudioLibrary.getAlbums with params {"jsonrpc":"2.0","method":"AudioLibrary.GetAlbums","params":{"genreid": -1 ,"artistid": -1 ,"start": -1,"end": -1 }, "id":"AudioLibraryGetAlbums"}

returns a strange result :

{

  "id" : "AudioLibraryGetAlbums",
  "jsonrpc" : "2.0",
  "result" : {
     "end" : 0,
     "start" : 0,
     "total" : 95

}