2011-02-11, 07:05
Ghostface, thanks for the bug report I will look into this today.
darkscout, that isn't my code! I think you may have the wrong thread
darkscout, that isn't my code! I think you may have the wrong thread
Quote:ÔÂÇò
Quote:Invalid JSON RPC response
$badvar = array('start' => $_POST['start'], 'end' => $_POST['end']);
try{
$response = $rpc->AudioLibrary->GetArtists($badvar);
} catch(XBMC_RPC_Exception $e) {
die($e->getMessage());
}
dann0 Wrote:Hi Mindzai,
I noticed if i send a request with a string where XBMC is expecting an integer it hangs the JSONRPC interface, i thought maybe you could catch that in your wrapper throwing an exception (or just converting the value to intval).
eg
PHP Code:$badvar = array('start' => $_POST['start'], 'end' => $_POST['end']);
try{
$response = $rpc->AudioLibrary->GetArtists($badvar);
} catch(XBMC_RPC_Exception $e) {
die($e->getMessage());
}
stops XBMC from responding on the JSON interface.
$response = $rpc->AudioPlayer->Stop();
$response = $rpc->XBMC->play();
Quote:if (is_array($params)) $params = $params[0];
$response = $rpc->XBMC->Play(array('file' => 'the\file\path'));