CC-4957 : Replay Gain undefined error, json response not being sent back properly.

This commit is contained in:
Naomi 2013-02-15 16:32:05 -05:00
parent d63865625d
commit fe611e7c6a
3 changed files with 9 additions and 8 deletions

View File

@ -42,8 +42,9 @@ class ApiController extends Zend_Controller_Action
->addActionContext('reload-metadata-group' , 'json') ->addActionContext('reload-metadata-group' , 'json')
->addActionContext('notify-webstream-data' , 'json') ->addActionContext('notify-webstream-data' , 'json')
->addActionContext('get-stream-parameters' , 'json') ->addActionContext('get-stream-parameters' , 'json')
->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')
->initContext(); ->initContext();
} }
@ -919,10 +920,6 @@ class ApiController extends Zend_Controller_Action
public function updateReplayGainValueAction() public function updateReplayGainValueAction()
{ {
// disable layout
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest(); $request = $this->getRequest();
$data = json_decode($request->getParam('data')); $data = json_decode($request->getParam('data'));
@ -933,6 +930,8 @@ class ApiController extends Zend_Controller_Action
$file->setDbReplayGain($gain); $file->setDbReplayGain($gain);
$file->save(); $file->save();
} }
$this->view->msg = "OK";
} }
public function updateCueValuesBySilanAction() public function updateCueValuesBySilanAction()

View File

@ -115,7 +115,7 @@ get_bootstrap_info = 'get-bootstrap-info/format/json/api_key/%%api_key%%'
get_files_without_replay_gain = 'get-files-without-replay-gain/api_key/%%api_key%%/dir_id/%%dir_id%%' get_files_without_replay_gain = 'get-files-without-replay-gain/api_key/%%api_key%%/dir_id/%%dir_id%%'
update_replay_gain_value = 'update-replay-gain-value/api_key/%%api_key%%' update_replay_gain_value = 'update-replay-gain-value/format/json/api_key/%%api_key%%'
notify_webstream_data = 'notify-webstream-data/api_key/%%api_key%%/media_id/%%media_id%%/format/json' notify_webstream_data = 'notify-webstream-data/api_key/%%api_key%%/media_id/%%media_id%%/format/json'

View File

@ -58,7 +58,9 @@ class ReplayGainUpdater(Thread):
try: try:
self.api_client.update_replay_gain_values(processed_data) self.api_client.update_replay_gain_values(processed_data)
except Exception as e: self.unexpected_exception(e) except Exception as e:
self.logger.error(e)
self.logger.debug(traceback.format_exc())
if len(files) == 0: break if len(files) == 0: break
self.logger.info("Processed: %d songs" % total) self.logger.info("Processed: %d songs" % total)