Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer-saas
This commit is contained in:
commit
65ea0e6d6f
|
@ -376,6 +376,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
|
||||
private function validateRequestData($file, &$whiteList)
|
||||
{
|
||||
try {
|
||||
// EditAudioMD form is used here for validation
|
||||
$fileForm = new Application_Form_EditAudioMD();
|
||||
$fileForm->startForm($file->getDbId());
|
||||
|
@ -401,6 +402,9 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
}
|
||||
|
||||
if (!$fileForm->isValidPartial($whiteList)) {
|
||||
throw Exception("Data validation failed");
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$errors = $fileForm->getErrors();
|
||||
$messages = $fileForm->getMessages();
|
||||
Logging::error($messages);
|
||||
|
|
|
@ -132,7 +132,10 @@ class MetadataAnalyzer(Analyzer):
|
|||
# Some tags are returned as lists because there could be multiple values.
|
||||
# This is unusual so we're going to always just take the first item in the list.
|
||||
if isinstance(metadata[airtime_tag], list):
|
||||
if metadata[airtime_tag]:
|
||||
metadata[airtime_tag] = metadata[airtime_tag][0]
|
||||
else: # Handle empty lists
|
||||
metadata[airtime_tag] = ""
|
||||
|
||||
except KeyError:
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue