Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
67483f8bb2
|
@ -13,6 +13,11 @@ require_once "Database.php";
|
|||
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
|
||||
|
||||
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
require_once (APPLICATION_PATH."/logging/Logging.php");
|
||||
Logging::setLogPath('/var/log/airtime/zendphp.log');
|
||||
|
||||
date_default_timezone_set(Application_Model_Preference::GetTimezone());
|
||||
|
||||
global $CC_CONFIG;
|
||||
|
|
|
@ -197,16 +197,20 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
$elementMap['type'] = $track['type'];
|
||||
|
||||
if ($track['type'] == 0) {
|
||||
$fileExtension = pathinfo($track['path'], PATHINFO_EXTENSION);
|
||||
$mime = $track['mime'];
|
||||
//type is file
|
||||
//TODO: use MIME type for this
|
||||
if (strtolower($fileExtension) === 'mp3') {
|
||||
if (strtolower($mime) === 'audio/mp3') {
|
||||
$elementMap['element_mp3'] = $track['item_id'];
|
||||
} elseif (strtolower($fileExtension) === 'ogg') {
|
||||
} elseif (strtolower($mime) === 'audio/ogg') {
|
||||
$elementMap['element_oga'] = $track['item_id'];
|
||||
} elseif (strtolower($mime) === 'audio/mp4') {
|
||||
$elementMap['element_m4a'] = $track['item_id'];
|
||||
} elseif (strtolower($mime) === 'audio/wav') {
|
||||
$elementMap['element_wav'] = $track['item_id'];
|
||||
} elseif (strtolower($mime) === 'audio/x-flac') {
|
||||
$elementMap['element_flac'] = $track['item_id'];
|
||||
} else {
|
||||
//the media was neither mp3 or ogg
|
||||
throw new Exception("Unknown file type");
|
||||
throw new Exception("Unknown file type: $mime");
|
||||
}
|
||||
|
||||
$elementMap['uri'] = "/api/get-media/file/".$track['item_id'];
|
||||
|
@ -278,14 +282,19 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
|
||||
$elementMap['type'] = $track['type'];
|
||||
if ($track['type'] == 0) {
|
||||
$fileExtension = pathinfo($track['filepath'], PATHINFO_EXTENSION);
|
||||
if (strtolower($fileExtension) === 'mp3') {
|
||||
$mime = $track['mime'];
|
||||
if (strtolower($mime) === 'audio/mp3') {
|
||||
$elementMap['element_mp3'] = $track['item_id'];
|
||||
} elseif (strtolower($fileExtension) === 'ogg') {
|
||||
} elseif (strtolower($mime) === 'audio/ogg') {
|
||||
$elementMap['element_oga'] = $track['item_id'];
|
||||
} elseif (strtolower($mime) === 'audio/mp4') {
|
||||
$elementMap['element_m4a'] = $track['item_id'];
|
||||
} elseif (strtolower($mime) === 'audio/wav') {
|
||||
$elementMap['element_wav'] = $track['item_id'];
|
||||
} elseif (strtolower($mime) === 'audio/x-flac') {
|
||||
$elementMap['element_flac'] = $track['item_id'];
|
||||
} else {
|
||||
//the media was neither mp3 or ogg
|
||||
throw new Exception("Unknown file type");
|
||||
throw new Exception("Unknown file type: $mime");
|
||||
}
|
||||
|
||||
$elementMap['uri'] = "/api/get-media/file/".$track['item_id'];
|
||||
|
|
|
@ -93,10 +93,9 @@ class Application_Model_Preference
|
|||
}
|
||||
$result = $con->query($sql)->fetchColumn(0);
|
||||
//$result = Application_Common_Database::prepareAndExecute($sql, $paramMap, 'column');
|
||||
if ($result == 0)
|
||||
|
||||
if ($result == 0) {
|
||||
return "";
|
||||
else {
|
||||
} else {
|
||||
$sql = "SELECT valstr FROM cc_pref"
|
||||
." WHERE keystr = '$key'";
|
||||
/*." WHERE keystr = :key";
|
||||
|
|
|
@ -51,7 +51,6 @@ $application = new Zend_Application(
|
|||
APPLICATION_PATH . '/configs/application.ini'
|
||||
);
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
require_once (APPLICATION_PATH."/logging/Logging.php");
|
||||
Logging::setLogPath('/var/log/airtime/zendphp.log');
|
||||
|
||||
|
|
|
@ -136,7 +136,17 @@ function buildplaylist(p_url, p_playIndex) {
|
|||
artist: data[index]['element_artist'],
|
||||
oga:data[index]['uri']
|
||||
};
|
||||
}
|
||||
} else if (data[index]['element_m4a'] != undefined) {
|
||||
media = {title: data[index]['element_title'],
|
||||
artist: data[index]['element_artist'],
|
||||
m4a:data[index]['uri']
|
||||
};
|
||||
} else if (data[index]['element_wav'] != undefined) {
|
||||
media = {title: data[index]['element_title'],
|
||||
artist: data[index]['element_artist'],
|
||||
wav:data[index]['uri']
|
||||
};
|
||||
}
|
||||
} else if (data[index]['type'] == 1) {
|
||||
media = {title: data[index]['element_title'],
|
||||
artist: data[index]['element_artist'],
|
||||
|
|
Loading…
Reference in New Issue