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. //user clicks play button for track and downloads it.
header('Content-Disposition: inline; filename="'.$file_base_name.'"'); header('Content-Disposition: inline; filename="'.$file_base_name.'"');
} }
if ($ext === 'mp3'){ if (strtolower($ext) === 'mp3'){
$this->smartReadFile($filepath, 'audio/mpeg'); $this->smartReadFile($filepath, 'audio/mpeg');
} else { } else {
$this->smartReadFile($filepath, 'audio/'.$ext); $this->smartReadFile($filepath, 'audio/'.$ext);

View File

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

View File

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

View File

@ -886,9 +886,9 @@ Logging::log("getting media! - 2");
} }
// Check if file is playable // 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); 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."); $result = array("code" => 110, "message" => "This file appears to be corrupted and will not be added to media library.");
} }
else { else {

View File

@ -166,25 +166,23 @@ function play(p_playlistIndex){
*/ */
function playOne(p_audioFileID) { function playOne(p_audioFileID) {
var playlist = new Array(); var playlist = new Array();
var fileExtensioin = p_audioFileID.split('.').pop(); var fileExtension = p_audioFileID.split('.').pop();
console.log(p_audioFileID); if (fileExtension.toLowerCase() === 'mp3') {
if (fileExtensioin === 'mp3') {
media = {title: $('.audioFileTitle').text() !== 'null' ?$('.audioFileTitle').text():"", media = {title: $('.audioFileTitle').text() !== 'null' ?$('.audioFileTitle').text():"",
artist: $('.audioFileArtist').text() !== 'null' ?$('.audioFileArtist').text():"", artist: $('.audioFileArtist').text() !== 'null' ?$('.audioFileArtist').text():"",
mp3:"/api/get-media/file/"+p_audioFileID mp3:"/api/get-media/file/"+p_audioFileID
}; };
}else if (fileExtensioin === 'ogg' ) { }else if (fileExtension.toLowerCase() === 'ogg' ) {
media = {title: $('.audioFileTitle').text() != 'null' ?$('.audioFileTitle').text():"", media = {title: $('.audioFileTitle').text() != 'null' ?$('.audioFileTitle').text():"",
artist: $('.audioFileArtist').text() != 'null' ?$('.audioFileArtist').text():"", artist: $('.audioFileArtist').text() != 'null' ?$('.audioFileArtist').text():"",
oga:"/api/get-media/file/"+p_audioFileID oga:"/api/get-media/file/"+p_audioFileID
}; };
} }
_playlist_jplayer.option("autoPlay", true); _playlist_jplayer.option("autoPlay", true);
console.log(media);
playlist[0] = media; playlist[0] = media;
//_playlist_jplayer.setPlaylist(playlist); --if I use this the player will call _init on the setPlaylist and on the ready //_playlist_jplayer.setPlaylist(playlist); --if I use this the player will call _init on the setPlaylist and on the ready
_playlist_jplayer._initPlaylist(playlist); _playlist_jplayer._initPlaylist(playlist);
_playlist_jplayer.play(0); _playlist_jplayer.play(0);
window.resizeTo(490, 167); window.resizeTo(490, 167);
} }

View File

@ -301,6 +301,7 @@ var AIRTIME = (function(AIRTIME){
if (!$el.hasClass("ui-state-disabled")) { if (!$el.hasClass("ui-state-disabled")) {
$el.addClass("ui-state-hover"); $el.addClass("ui-state-hover");
$("#show_builder .ui-icon-document-b").contextMenu(true);
} }
else { else {
$("#show_builder .ui-icon-document-b").contextMenu(false); $("#show_builder .ui-icon-document-b").contextMenu(false);

View File

@ -212,7 +212,7 @@ class MediaMonitorCommon:
try: try:
#will be in the format .ext #will be in the format .ext
file_ext = os.path.splitext(original_path)[1] file_ext = os.path.splitext(original_path)[1].lower()
path_md = ['MDATA_KEY_TITLE', 'MDATA_KEY_CREATOR', 'MDATA_KEY_SOURCE', 'MDATA_KEY_TRACKNUMBER', 'MDATA_KEY_BITRATE'] path_md = ['MDATA_KEY_TITLE', 'MDATA_KEY_CREATOR', 'MDATA_KEY_SOURCE', 'MDATA_KEY_TRACKNUMBER', 'MDATA_KEY_BITRATE']
md = {} md = {}