cc-4105: added a method in API client corresponding to chunked requests.\nAlso add prepared corresponding apicontroller method

This commit is contained in:
Rudi Grinberg 2012-07-13 17:57:18 -04:00 committed by Martin Konecny
parent 44d91f7798
commit 71dc7d99b4
3 changed files with 33 additions and 16 deletions

View file

@ -33,6 +33,7 @@ class ApiController extends Zend_Controller_Action
->addActionContext('update-source-status', 'json')
->addActionContext('get-bootstrap-info', 'json')
->addActionContext('get-files-without-replay-gain', 'json')
->addActionContext('reload-metadata-group', 'json')
->initContext();
}
@ -550,14 +551,16 @@ class ApiController extends Zend_Controller_Action
//The key does not have any meaning as of yet but it could potentially correspond
//to some unique id.
$responses = array();
Logging::log("inside reloadMetadataGroupAction");
return;
foreach ($request->getRequest()->getParams() as $action => $raw_json) {
foreach ($request->getParams() as $k => $raw_json) {
$info_json = json_decode($raw_json, $assoc=true);
array_push($responses, $this->dispatchMetaDataAction($info_json, $info_json['mode']));
$mode = $info_json['mode'];
unset($info_json['mode']);
// TODO : uncomment the following line to actually do something
// array_push($responses, $this->dispatchMetaDataAction($info_json, $info_json['mode']));
// Like wise, remove the following line when done
Logging::log( $info_json );
}
// TODO : do something with $responses here instead of doing nothing
die(json_encode( array('successes' => 19, 'fails' => 123) ));
}
public function reloadMetadataAction()