Talk:JSON-RPC API: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Divol
>Divol
Line 29: Line 29:
<pre>
<pre>


  if (!(ParameterIntOrNull(param, "artistid") || ParameterIntOrNull(param, "genreid"))) //jd:
  if (!(ParameterIntOrNull(param, "artistid") || ParameterIntOrNull(param, "albumid")));
 
</pre>
</pre>


Line 37: Line 36:
<pre>  
<pre>  


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


</pre>
</pre>

Revision as of 08:50, 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: