Merge branch '2.1.x' into devel

This commit is contained in:
denise 2012-06-12 15:49:18 -04:00
commit 8b2353ede0
7 changed files with 15 additions and 15 deletions

View file

@ -148,7 +148,7 @@ class ApiController extends Zend_Controller_Action
//user clicks play button for track and downloads it.
header('Content-Disposition: inline; filename="'.$file_base_name.'"');
}
if ($ext === 'mp3'){
if (strtolower($ext) === 'mp3'){
$this->smartReadFile($filepath, 'audio/mpeg');
} else {
$this->smartReadFile($filepath, 'audio/'.$ext);

View file

@ -106,9 +106,9 @@ class AudiopreviewController extends Zend_Controller_Action
'element_position' => isset($track['position'])?$track['position']:"",
);
$fileExtension = pathinfo($track['CcFiles']['filepath'], PATHINFO_EXTENSION);
if ($fileExtension === 'mp3'){
if (strtolower($fileExtension) === 'mp3'){
$elementMap['element_mp3'] = $track['CcFiles']['gunid'].'.'.$fileExtension;
} else if( $fileExtension === 'ogg') {
} else if(strtolower($fileExtension) === 'ogg') {
$elementMap['element_oga'] = $track['CcFiles']['gunid'].'.'.$fileExtension;
} else {
//the media was neither mp3 or ogg
@ -181,9 +181,9 @@ class AudiopreviewController extends Zend_Controller_Action
);
$fileExtension = pathinfo($track['filepath'], PATHINFO_EXTENSION);
if ($fileExtension === 'mp3'){
if (strtolower($fileExtension) === 'mp3'){
$elementMap['element_mp3'] = $track['gunid'].'.'.$fileExtension;
} else if( $fileExtension === 'ogg') {
} else if(strtolower($fileExtension) === 'ogg') {
$elementMap['element_oga'] = $track['gunid'].'.'.$fileExtension;
} else {
//the media was neither mp3 or ogg

View file

@ -33,7 +33,8 @@ class Application_Form_EditAudioMD extends Zend_Form
'label' => 'Track:',
'class' => 'input_text',
'filters' => array('StringTrim'),
'validators' => array('Int')
'validators' => array('Int'),
'required' => true
));
// Add genre field

View file

@ -886,9 +886,9 @@ Logging::log("getting media! - 2");
}
// Check if file is playable
$command = sprintf("/usr/bin/airtime-liquidsoap -c 'output.dummy(audio_to_stereo(single(\"%s\")))' > /dev/null 2>&1", $audio_file);
$command = sprintf("/usr/bin/airtime-liquidsoap -c 'output.dummy(audio_to_stereo(single(\"%s\")))' 2>&1", $audio_file);
exec($command, $output, $rv);
if ($rv != 0) {
if ($rv != 0 || count($output) != 0) {
$result = array("code" => 110, "message" => "This file appears to be corrupted and will not be added to media library.");
}
else {