CC-4975: airtime-silan cmd error

-fixed
This commit is contained in:
Martin Konecny 2013-02-25 19:45:26 -05:00
parent e35416b1e8
commit e08732fba7
3 changed files with 12 additions and 5 deletions

View file

@ -45,6 +45,7 @@ class ApiController extends Zend_Controller_Action
->addActionContext('push-stream-stats' , 'json') ->addActionContext('push-stream-stats' , 'json')
->addActionContext('update-stream-setting-table' , 'json') ->addActionContext('update-stream-setting-table' , 'json')
->addActionContext('update-replay-gain-value' , 'json') ->addActionContext('update-replay-gain-value' , 'json')
->addActionContext('update-cue-values-by-silan' , 'json')
->initContext(); ->initContext();
} }
@ -962,13 +963,13 @@ class ApiController extends Zend_Controller_Action
public function updateCueValuesBySilanAction() public function updateCueValuesBySilanAction()
{ {
// disable layout // disable the view and the layout
$this->view->layout()->disableLayout(); $this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true); $this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest(); $request = $this->getRequest();
$data = json_decode($request->getParam('data')); $data = json_decode($request->getParam('data'));
Logging::info($data);
foreach ($data as $pair) { foreach ($data as $pair) {
list($id, $info) = $pair; list($id, $info) = $pair;
// TODO : move this code into model -- RG // TODO : move this code into model -- RG
@ -980,6 +981,8 @@ class ApiController extends Zend_Controller_Action
$file->setDbSilanCheck(true); $file->setDbSilanCheck(true);
$file->save(); $file->save();
} }
echo json_encode(array());
} }
public function notifyWebstreamDataAction() public function notifyWebstreamDataAction()

View file

@ -92,7 +92,11 @@ class ApiRequest(object):
raise raise
# Ghetto hack for now because we don't the content type we are getting # Ghetto hack for now because we don't the content type we are getting
# (Pointless to look at mime since it's not being set correctly always) # (Pointless to look at mime since it's not being set correctly always)
return json.loads(response) try:
return json.loads(response)
except Exception:
self.logger.error(response)
raise
def req(self, *args, **kwargs): def req(self, *args, **kwargs):
self.__req = lambda : self(*args, **kwargs) self.__req = lambda : self(*args, **kwargs)

View file

@ -67,7 +67,7 @@ try:
break break
print "Processed: %d songs" % total print "Processed: %d songs" % total
subtotal += total subtotal += total
total = 0
try: try:
print api_client.update_cue_values_by_silan(processed_data) print api_client.update_cue_values_by_silan(processed_data)
except Exception ,e: except Exception ,e: