From f6e76b79a4c602573331caef1178d3ebde08759c Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Tue, 17 Jul 2012 14:19:22 -0400 Subject: [PATCH] cc-4105: reloadMetadataGroupAction seems to be ready for production.\nSet the parameter correctly after finishing the debugging from the python side --- airtime_mvc/application/controllers/ApiController.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index d0ae4a568..ab9eb8eaa 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -539,8 +539,8 @@ class ApiController extends Zend_Controller_Action // to some unique id. $responses = array(); $params = $request->getParams(); - die( json_encode($params) ); foreach ($request->getParams() as $k => $raw_json) { + // Valid requests must start with mdXXX where XXX represents at least 1 digit if( !preg_match('/^md\d+$/', $k) ) { continue; } $info_json = json_decode($raw_json, $assoc=true); if( !array_key_exists('mode', $info_json) ) { @@ -549,12 +549,11 @@ class ApiController extends Zend_Controller_Action array_push( $responses, array('error' => "Bad request. no 'mode' parameter passed.") ); continue; } - Logging::log("we got here mang"); - die( json_encode('damn straight') ); + // Removing 'mode' key from $info_json might not be necessary... $mode = $info_json['mode']; unset( $info_json['mode'] ); // TODO : remove the $dry_run parameter after finished testing - $response = $this->dispatchMetadataAction($info_json, $info_json['mode'], $dry_run=true); + $response = $this->dispatchMetadataAction($info_json, $mode, $dry_run=true); array_push($responses, $response); // On recorded show requests we do some extra work here. Not sure what it actually is and it // was usually called from the python api. Now we just call it straight from the controller to @@ -562,8 +561,6 @@ class ApiController extends Zend_Controller_Action if( $info_json['is_record'] and !array_key_exists('error', $response) ) { $this->uploadRecordedActionParam($info_json['showinstanceid'],$info_json['fileid']); } - // TODO : Remove this line when done debugging - Logging::log( $info_json ); } die( json_encode($responses) ); }