Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
James 2012-09-13 10:49:33 -04:00
commit 5067a304d9
49 changed files with 8820 additions and 3978 deletions

View File

@ -44,13 +44,13 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$view = $this->getResource('view'); $view = $this->getResource('view');
$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl(); $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
$baseDir = dirname($_SERVER['SCRIPT_FILENAME']);
$view->headLink()->appendStylesheet($baseUrl.'/css/redmond/jquery-ui-1.8.8.custom.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'/css/redmond/jquery-ui-1.8.8.custom.css?'.$CC_CONFIG['airtime_version']);
$view->headLink()->appendStylesheet($baseUrl.'/css/pro_dropdown_3.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'/css/pro_dropdown_3.css?'.$CC_CONFIG['airtime_version']);
$view->headLink()->appendStylesheet($baseUrl.'/css/qtip/jquery.qtip.min.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'/css/qtip/jquery.qtip.min.css?'.$CC_CONFIG['airtime_version']);
$view->headLink()->appendStylesheet($baseUrl.'/css/styles.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'/css/styles.css?'.$CC_CONFIG['airtime_version']);
$view->headLink()->appendStylesheet($baseUrl.'/css/masterpanel.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'/css/masterpanel.css?'.$CC_CONFIG['airtime_version']);
$view->headLink()->appendStylesheet($baseUrl.'/css/bootstrap.css?'.$CC_CONFIG['airtime_version']);
} }
protected function _initHeadScript() protected function _initHeadScript()
@ -59,7 +59,6 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$view = $this->getResource('view'); $view = $this->getResource('view');
$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl(); $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
$baseDir = dirname($_SERVER['SCRIPT_FILENAME']);
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery-1.7.2.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/libs/jquery-1.7.2.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery-ui-1.8.18.custom.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/libs/jquery-ui-1.8.18.custom.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
@ -67,6 +66,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$view->headScript()->appendFile($baseUrl.'/js/qtip/jquery.qtip.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/qtip/jquery.qtip.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/jplayer/jquery.jplayer.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/jplayer/jquery.jplayer.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/sprintf/sprintf-0.7-beta1.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/sprintf/sprintf-0.7-beta1.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/bootstrap/bootstrap.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendScript("var baseUrl='$baseUrl/'"); $view->headScript()->appendScript("var baseUrl='$baseUrl/'");
//scripts for now playing bar //scripts for now playing bar
@ -76,6 +76,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$view->headScript()->appendFile($baseUrl.'/js/airtime/common/common.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/airtime/common/common.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/airtime/common/audioplaytest.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$user = Application_Model_User::getCurrentUser(); $user = Application_Model_User::getCurrentUser();
if (!is_null($user)){ if (!is_null($user)){
@ -85,6 +86,8 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
} }
$view->headScript()->appendScript("var userType = '$userType';"); $view->headScript()->appendScript("var userType = '$userType';");
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) { if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) {
$view->headScript()->appendFile($baseUrl.'/js/libs/google-analytics.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/libs/google-analytics.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
} }

View File

@ -8,33 +8,33 @@ class ApiController extends Zend_Controller_Action
$this->checkAuth(); $this->checkAuth();
/* Initialize action controller here */ /* Initialize action controller here */
$context = $this->_helper->getHelper('contextSwitch'); $context = $this->_helper->getHelper('contextSwitch');
$context->addActionContext('version', 'json') $context->addActionContext('version' , 'json')
->addActionContext('recorded-shows', 'json') ->addActionContext('recorded-shows' , 'json')
->addActionContext('calendar-init', 'json') ->addActionContext('calendar-init' , 'json')
->addActionContext('upload-file', 'json') ->addActionContext('upload-file' , 'json')
->addActionContext('upload-recorded', 'json') ->addActionContext('upload-recorded' , 'json')
->addActionContext('media-monitor-setup', 'json') ->addActionContext('media-monitor-setup' , 'json')
->addActionContext('media-item-status', 'json') ->addActionContext('media-item-status' , 'json')
->addActionContext('reload-metadata', 'json') ->addActionContext('reload-metadata' , 'json')
->addActionContext('list-all-files', 'json') ->addActionContext('list-all-files' , 'json')
->addActionContext('list-all-watched-dirs', 'json') ->addActionContext('list-all-watched-dirs' , 'json')
->addActionContext('add-watched-dir', 'json') ->addActionContext('add-watched-dir' , 'json')
->addActionContext('remove-watched-dir', 'json') ->addActionContext('remove-watched-dir' , 'json')
->addActionContext('set-storage-dir', 'json') ->addActionContext('set-storage-dir' , 'json')
->addActionContext('get-stream-setting', 'json') ->addActionContext('get-stream-setting' , 'json')
->addActionContext('status', 'json') ->addActionContext('status' , 'json')
->addActionContext('register-component', 'json') ->addActionContext('register-component' , 'json')
->addActionContext('update-liquidsoap-status', 'json') ->addActionContext('update-liquidsoap-status' , 'json')
->addActionContext('live-chat', 'json') ->addActionContext('live-chat' , 'json')
->addActionContext('update-file-system-mount', 'json') ->addActionContext('update-file-system-mount' , 'json')
->addActionContext('handle-watched-dir-missing', 'json') ->addActionContext('handle-watched-dir-missing' , 'json')
->addActionContext('rabbitmq-do-push', 'json') ->addActionContext('rabbitmq-do-push' , 'json')
->addActionContext('check-live-stream-auth', 'json') ->addActionContext('check-live-stream-auth' , 'json')
->addActionContext('update-source-status', 'json') ->addActionContext('update-source-status' , 'json')
->addActionContext('get-bootstrap-info', 'json') ->addActionContext('get-bootstrap-info' , 'json')
->addActionContext('get-files-without-replay-gain', 'json') ->addActionContext('get-files-without-replay-gain' , 'json')
->addActionContext('reload-metadata-group', 'json') ->addActionContext('reload-metadata-group' , 'json')
->addActionContext('notify-webstream-data', 'json') ->addActionContext('notify-webstream-data' , 'json')
->initContext(); ->initContext();
} }
@ -73,7 +73,8 @@ class ApiController extends Zend_Controller_Action
$this->view->layout()->disableLayout(); $this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true); $this->_helper->viewRenderer->setNoRender(true);
$jsonStr = json_encode(array("version"=>Application_Model_Preference::GetAirtimeVersion())); $jsonStr = json_encode( array(
"version" => Application_Model_Preference::GetAirtimeVersion()));
echo $jsonStr; echo $jsonStr;
} }
@ -94,11 +95,11 @@ class ApiController extends Zend_Controller_Action
} }
$this->view->calendarInit = array( $this->view->calendarInit = array(
"timestamp" => time(), "timestamp" => time(),
"timezoneOffset" => date("Z"), "timezoneOffset" => date("Z"),
"timeScale" => Application_Model_Preference::GetCalendarTimeScale(), "timeScale" => Application_Model_Preference::GetCalendarTimeScale(),
"timeInterval" => Application_Model_Preference::GetCalendarTimeInterval(), "timeInterval" => Application_Model_Preference::GetCalendarTimeInterval(),
"weekStartDay" => Application_Model_Preference::GetWeekStartDay() "weekStartDay" => Application_Model_Preference::GetWeekStartDay()
); );
} }
@ -349,7 +350,7 @@ class ApiController extends Zend_Controller_Action
$media_id = $this->_getParam("media_id"); $media_id = $this->_getParam("media_id");
Logging::debug("Received notification of new media item start: $media_id"); Logging::debug("Received notification of new media item start: $media_id");
$result = Application_Model_Schedule::UpdateMediaPlayedStatus($media_id); Application_Model_Schedule::UpdateMediaPlayedStatus($media_id);
//set a 'last played' timestamp for media item //set a 'last played' timestamp for media item
//needed for smart blocks //needed for smart blocks
@ -437,13 +438,10 @@ class ApiController extends Zend_Controller_Action
$file = Application_Model_StoredFile::Recall($file_id); $file = Application_Model_StoredFile::Recall($file_id);
//$show_instance = $this->_getParam('show_instance'); //$show_instance = $this->_getParam('show_instance');
$show_name = null;
try { try {
$show_inst = new Application_Model_ShowInstance($show_instance_id); $show_inst = new Application_Model_ShowInstance($show_instance_id);
$show_inst->setRecordedFile($file_id); $show_inst->setRecordedFile($file_id);
$show_name = $show_inst->getName(); //$show_start_time = Application_Common_DateHelper::ConvertToLocalDateTimeString($show_inst->getShowInstanceStart());
$show_genre = $show_inst->getGenre();
$show_start_time = Application_Common_DateHelper::ConvertToLocalDateTimeString($show_inst->getShowInstanceStart());
} catch (Exception $e) { } catch (Exception $e) {
//we've reached here probably because the show was //we've reached here probably because the show was
@ -454,6 +452,8 @@ class ApiController extends Zend_Controller_Action
$showCanceled = true; $showCanceled = true;
} }
// TODO : the following is inefficient because it calls save on both
// fields
$file->setMetadataValue('MDATA_KEY_CREATOR', "Airtime Show Recorder"); $file->setMetadataValue('MDATA_KEY_CREATOR', "Airtime Show Recorder");
$file->setMetadataValue('MDATA_KEY_TRACKNUMBER', $show_instance_id); $file->setMetadataValue('MDATA_KEY_TRACKNUMBER', $show_instance_id);
@ -481,11 +481,12 @@ class ApiController extends Zend_Controller_Action
public function dispatchMetadata($md, $mode) public function dispatchMetadata($md, $mode)
{ {
// Replace this compound result in a hash with proper error handling later on
$return_hash = array(); $return_hash = array();
Application_Model_Preference::SetImportTimestamp(); Application_Model_Preference::SetImportTimestamp();
//Logging::info("--->Mode: $mode || file: {$md['MDATA_KEY_FILEPATH']} "); //Logging::info("--->Mode: $mode || file: {$md['MDATA_KEY_FILEPATH']} ");
//Logging::info( $md ); //Logging::info( $md );
// create also modifies the file if it exists
if ($mode == "create") { if ($mode == "create") {
$filepath = $md['MDATA_KEY_FILEPATH']; $filepath = $md['MDATA_KEY_FILEPATH'];
$filepath = Application_Common_OsPath::normpath($filepath); $filepath = Application_Common_OsPath::normpath($filepath);
@ -513,11 +514,11 @@ class ApiController extends Zend_Controller_Action
$file->setMetadata($md); $file->setMetadata($md);
} }
} elseif ($mode == "moved") { } elseif ($mode == "moved") {
$md5 = $md['MDATA_KEY_MD5']; $file = Application_Model_StoredFile::RecallByFilepath(
$file = Application_Model_StoredFile::RecallByMd5($md5); $md['MDATA_KEY_ORIGINAL_PATH']);
if (is_null($file)) { if (is_null($file)) {
return "File doesn't exist in Airtime."; $return_hash['error'] = 'File does not exist in Airtime';
} else { } else {
$filepath = $md['MDATA_KEY_FILEPATH']; $filepath = $md['MDATA_KEY_FILEPATH'];
//$filepath = str_replace("\\", "", $filepath); //$filepath = str_replace("\\", "", $filepath);
@ -549,7 +550,8 @@ class ApiController extends Zend_Controller_Action
return $return_hash; return $return_hash;
} }
$return_hash['fileid'] = $file->getId();
$return_hash['fileid'] = is_null($file) ? '-1' : $file->getId();
return $return_hash; return $return_hash;
} }
@ -562,15 +564,13 @@ class ApiController extends Zend_Controller_Action
// to some unique id. // to some unique id.
$request = $this->getRequest(); $request = $this->getRequest();
$responses = array(); $responses = array();
$dry = $request->getParam('dry') || false; //$params = $request->getParams();
$params = $request->getParams();
$valid_modes = array('delete_dir', 'delete', 'moved', 'modify', 'create'); $valid_modes = array('delete_dir', 'delete', 'moved', 'modify', 'create');
foreach ($request->getParams() as $k => $raw_json) { foreach ($params as $k => $raw_json) {
// Valid requests must start with mdXXX where XXX represents at // Valid requests must start with mdXXX where XXX represents at
// least 1 digit // least 1 digit
if ( !preg_match('/^md\d+$/', $k) ) { continue; } if ( !preg_match('/^md\d+$/', $k) ) { continue; }
$info_json = json_decode($raw_json, $assoc = true); $info_json = json_decode($raw_json, $assoc = true);
$recorded = $info_json["is_record"];
unset( $info_json["is_record"] ); unset( $info_json["is_record"] );
// Log invalid requests // Log invalid requests
if ( !array_key_exists('mode', $info_json) ) { if ( !array_key_exists('mode', $info_json) ) {
@ -604,100 +604,6 @@ class ApiController extends Zend_Controller_Action
die( json_encode($responses) ); die( json_encode($responses) );
} }
public function reloadMetadataAction()
{
$request = $this->getRequest();
$mode = $request->getParam('mode');
$params = $request->getParams();
$md = array();
//extract all file metadata params from the request.
foreach ($params as $key => $value) {
if (preg_match('/^MDATA_KEY/', $key)) {
$md[$key] = $value;
}
}
Logging::info( $md );
// update import timestamp
Application_Model_Preference::SetImportTimestamp();
if ($mode == "create") {
$filepath = $md['MDATA_KEY_FILEPATH'];
//$filepath = str_replace("\\", "", $filepath);
//$filepath = str_replace("//", "/", $filepath);
$filepath = Application_Common_OsPath::normpath($filepath);
$file = Application_Model_StoredFile::RecallByFilepath($filepath);
if (is_null($file)) {
$file = Application_Model_StoredFile::Insert($md);
} else {
// path already exist
if ($file->getFileExistsFlag()) {
// file marked as exists
$this->view->error = "File already exists in Airtime.";
return;
} else {
// file marked as not exists
$file->setFileExistsFlag(true);
$file->setMetadata($md);
}
}
} elseif ($mode == "modify") {
$filepath = $md['MDATA_KEY_FILEPATH'];
//$filepath = str_replace("\\", "", $filepath);
$file = Application_Model_StoredFile::RecallByFilepath($filepath);
//File is not in database anymore.
if (is_null($file)) {
$this->view->error = "File does not exist in Airtime.";
return;
} else {
//Updating a metadata change.
$file->setMetadata($md);
}
} elseif ($mode == "moved") {
$md5 = $md['MDATA_KEY_MD5'];
$file = Application_Model_StoredFile::RecallByMd5($md5);
if (is_null($file)) {
$this->view->error = "File doesn't exist in Airtime.";
return;
} else {
$filepath = $md['MDATA_KEY_FILEPATH'];
//$filepath = str_replace("\\", "", $filepath);
$file->setFilePath($filepath);
}
} elseif ($mode == "delete") {
$filepath = $md['MDATA_KEY_FILEPATH'];
//$filepath = str_replace("\\", "", $filepath);
$file = Application_Model_StoredFile::RecallByFilepath($filepath);
if (is_null($file)) {
$this->view->error = "File doesn't exist in Airtime.";
return;
} else {
$file->deleteByMediaMonitor();
}
} elseif ($mode == "delete_dir") {
$filepath = $md['MDATA_KEY_FILEPATH'];
//$filepath = str_replace("\\", "", $filepath);
$files = Application_Model_StoredFile::RecallByPartialFilepath($filepath);
foreach ($files as $file) {
$file->deleteByMediaMonitor();
}
return;
}
$this->view->id = $file->getId();
}
public function listAllFilesAction() public function listAllFilesAction()
{ {
$request = $this->getRequest(); $request = $this->getRequest();
@ -712,8 +618,6 @@ class ApiController extends Zend_Controller_Action
public function listAllWatchedDirsAction() public function listAllWatchedDirsAction()
{ {
$request = $this->getRequest();
$result = array(); $result = array();
$arrWatchedDirs = Application_Model_MusicDir::getWatchedDirs(); $arrWatchedDirs = Application_Model_MusicDir::getWatchedDirs();
@ -754,8 +658,6 @@ class ApiController extends Zend_Controller_Action
public function getStreamSettingAction() public function getStreamSettingAction()
{ {
$request = $this->getRequest();
$info = Application_Model_StreamSetting::getStreamSetting(); $info = Application_Model_StreamSetting::getStreamSetting();
$this->view->msg = $info; $this->view->msg = $info;
} }
@ -809,7 +711,6 @@ class ApiController extends Zend_Controller_Action
{ {
$request = $this->getRequest(); $request = $this->getRequest();
$msg = $request->getParam('msg');
$sourcename = $request->getParam('sourcename'); $sourcename = $request->getParam('sourcename');
$status = $request->getParam('status'); $status = $request->getParam('status');

View File

@ -29,8 +29,6 @@ class AudiopreviewController extends Zend_Controller_Action
$request = $this->getRequest(); $request = $this->getRequest();
$baseUrl = $request->getBaseUrl(); $baseUrl = $request->getBaseUrl();
$baseDir = dirname($_SERVER['SCRIPT_FILENAME']);
$this->view->headScript()->appendFile( $this->view->headScript()->appendFile(
$baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'], $baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],
'text/javascript'); 'text/javascript');
@ -84,8 +82,6 @@ class AudiopreviewController extends Zend_Controller_Action
$request = $this->getRequest(); $request = $this->getRequest();
$baseUrl = $request->getBaseUrl(); $baseUrl = $request->getBaseUrl();
$baseDir = dirname($_SERVER['SCRIPT_FILENAME']);
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'/js/jplayer/skin/jplayer.airtime.audio.preview.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'/js/jplayer/skin/jplayer.airtime.audio.preview.css?'.$CC_CONFIG['airtime_version']);
@ -113,8 +109,6 @@ class AudiopreviewController extends Zend_Controller_Action
$request = $this->getRequest(); $request = $this->getRequest();
$baseUrl = $request->getBaseUrl(); $baseUrl = $request->getBaseUrl();
$baseDir = dirname($_SERVER['SCRIPT_FILENAME']);
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'/js/jplayer/skin/jplayer.airtime.audio.preview.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'/js/jplayer/skin/jplayer.airtime.audio.preview.css?'.$CC_CONFIG['airtime_version']);
@ -236,8 +230,6 @@ class AudiopreviewController extends Zend_Controller_Action
$request = $this->getRequest(); $request = $this->getRequest();
$baseUrl = $request->getBaseUrl(); $baseUrl = $request->getBaseUrl();
$baseDir = dirname($_SERVER['SCRIPT_FILENAME']);
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'/js/jplayer/skin/jplayer.airtime.audio.preview.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'/js/jplayer/skin/jplayer.airtime.audio.preview.css?'.$CC_CONFIG['airtime_version']);

View File

@ -44,7 +44,6 @@ class DashboardController extends Zend_Controller_Action
public function switchSourceAction() public function switchSourceAction()
{ {
$request = $this->getRequest();
$sourcename = $this->_getParam('sourcename'); $sourcename = $this->_getParam('sourcename');
$current_status = $this->_getParam('status'); $current_status = $this->_getParam('status');

View File

@ -156,7 +156,7 @@ class LibraryController extends Zend_Controller_Action
$user = new Application_Model_User($userInfo->id); $user = new Application_Model_User($userInfo->id);
//Open a jPlayer window and play the audio clip. //Open a jPlayer window and play the audio clip.
$menu["play"] = array("name"=> "Preview", "icon" => "play"); $menu["play"] = array("name"=> "Preview", "icon" => "play", "disabled" => false);
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
@ -166,6 +166,8 @@ class LibraryController extends Zend_Controller_Action
$file = Application_Model_StoredFile::Recall($id); $file = Application_Model_StoredFile::Recall($id);
$menu["play"]["mime"] = $file->getPropelOrm()->getDbMime();
if (isset($obj_sess->id) && $screen == "playlist") { if (isset($obj_sess->id) && $screen == "playlist") {
// if the user is not admin or pm, check the creator and see if this person owns the playlist or Block // if the user is not admin or pm, check the creator and see if this person owns the playlist or Block
if ($obj_sess->type == 'playlist') { if ($obj_sess->type == 'playlist') {
@ -268,7 +270,7 @@ class LibraryController extends Zend_Controller_Action
$mediaItems = $this->_getParam('media', null); $mediaItems = $this->_getParam('media', null);
$user = Application_Model_User::getCurrentUser(); $user = Application_Model_User::getCurrentUser();
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); //$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
$files = array(); $files = array();
$playlists = array(); $playlists = array();

View File

@ -212,7 +212,6 @@ class PlaylistController extends Zend_Controller_Action
$objInfo = Application_Model_Library::getObjInfo($type); $objInfo = Application_Model_Library::getObjInfo($type);
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id);
$obj_sess = new Zend_Session_Namespace(UI_PLAYLISTCONTROLLER_OBJ_SESSNAME); $obj_sess = new Zend_Session_Namespace(UI_PLAYLISTCONTROLLER_OBJ_SESSNAME);
@ -300,7 +299,6 @@ class PlaylistController extends Zend_Controller_Action
$ids = $this->_getParam('ids'); $ids = $this->_getParam('ids');
$ids = (!is_array($ids)) ? array($ids) : $ids; $ids = (!is_array($ids)) ? array($ids) : $ids;
$afterItem = $this->_getParam('afterItem', null); $afterItem = $this->_getParam('afterItem', null);
$modified = $this->_getParam('modified');
$type = $this->_getParam('obj_type'); $type = $this->_getParam('obj_type');
try { try {

View File

@ -177,7 +177,6 @@ class ShowbuilderController extends Zend_Controller_Action
$now = floatval(microtime(true)); $now = floatval(microtime(true));
$request = $this->getRequest(); $request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$menu = array(); $menu = array();
$user = Application_Model_User::getCurrentUser(); $user = Application_Model_User::getCurrentUser();
@ -266,7 +265,6 @@ class ShowbuilderController extends Zend_Controller_Action
$ends_epoch = $request->getParam("end", $current_time + (60*60*24)); $ends_epoch = $request->getParam("end", $current_time + (60*60*24));
$show_filter = intval($request->getParam("showFilter", 0)); $show_filter = intval($request->getParam("showFilter", 0));
$my_shows = intval($request->getParam("myShows", 0)); $my_shows = intval($request->getParam("myShows", 0));
$timestamp = intval($request->getParam("timestamp", -1));
$startsDT = DateTime::createFromFormat("U", $starts_epoch, new DateTimeZone("UTC")); $startsDT = DateTime::createFromFormat("U", $starts_epoch, new DateTimeZone("UTC"));
$endsDT = DateTime::createFromFormat("U", $ends_epoch, new DateTimeZone("UTC")); $endsDT = DateTime::createFromFormat("U", $ends_epoch, new DateTimeZone("UTC"));
@ -347,8 +345,7 @@ class ShowbuilderController extends Zend_Controller_Action
public function scheduleReorderAction() public function scheduleReorderAction()
{ {
$request = $this->getRequest(); throw new Exception("this controller is/was a no-op please fix your
code");
$showInstance = $request->getParam("instanceId");
} }
} }

View File

@ -68,7 +68,7 @@ class WebstreamController extends Zend_Controller_Action
if ($webstream) { if ($webstream) {
Application_Model_Library::changePlaylist($id, "stream"); Application_Model_Library::changePlaylist($id, "stream");
} }
$this->view->obj = new Application_Model_Webstream($webstream); $this->view->obj = new Application_Model_Webstream($webstream->getDbId());
$this->view->action = "edit"; $this->view->action = "edit";
$this->view->html = $this->view->render('webstream/webstream.phtml'); $this->view->html = $this->view->render('webstream/webstream.phtml');
} }

View File

@ -12,7 +12,7 @@ class RabbitMqPlugin extends Zend_Controller_Plugin_Abstract
} }
} }
if (memory_get_peak_usage() > 25*pow(2, 20)) { if (memory_get_peak_usage() > 30*pow(2, 20)) {
Logging::debug("Peak memory usage: " Logging::debug("Peak memory usage: "
.(memory_get_peak_usage()/1000000) .(memory_get_peak_usage()/1000000)

View File

@ -87,9 +87,6 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
{ {
$valid = true; $valid = true;
$hours;
$minutes;
$start_time = $formData['add_show_start_date']." ".$formData['add_show_start_time']; $start_time = $formData['add_show_start_date']." ".$formData['add_show_start_time'];
$end_time = $formData['add_show_end_date_no_repeat']." ".$formData['add_show_end_time']; $end_time = $formData['add_show_end_date_no_repeat']." ".$formData['add_show_end_time'];
@ -202,7 +199,20 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
$repeatShowEnd->add(new DateInterval("P".$daysAdd."D")); $repeatShowEnd->add(new DateInterval("P".$daysAdd."D"));
} }
while ($repeatShowStart->getTimestamp() < $populateUntilDateTime->getTimestamp()) { while ($repeatShowStart->getTimestamp() < $populateUntilDateTime->getTimestamp()) {
$overlapping = Application_Model_Schedule::checkOverlappingShows($repeatShowStart, $repeatShowEnd, $update, $instanceId); //need to get each repeating show's instance id
$qry = CcShowInstancesQuery::create()
->filterByDbStarts($repeatShowStart->format('Y-m-d H:i:s'))
->filterByDbEnds($repeatShowEnd->format('Y-m-d H:i:s'))
->find();
$count = $qry->count();
if ($count > 1) {
$overlapping = true;
} elseif ($count == 1) {
$instanceId = $qry->getFirst()->getDbId();
$overlapping = Application_Model_Schedule::checkOverlappingShows($repeatShowStart, $repeatShowEnd, $update, $instanceId);
} else {
$overlapping = false;
}
if ($overlapping) { if ($overlapping) {
$valid = false; $valid = false;
$this->getElement('add_show_duration')->setErrors(array('Cannot schedule overlapping shows')); $this->getElement('add_show_duration')->setErrors(array('Cannot schedule overlapping shows'));

View File

@ -5,12 +5,12 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
0 => "Select criteria", 0 => "Select criteria",
"album_title" => "Album", "album_title" => "Album",
"bit_rate" => "Bit Rate (Kbps)", "bit_rate" => "Bit Rate (Kbps)",
"bpm" => "Bpm", "bpm" => "BPM",
"comments" => "Comments",
"composer" => "Composer", "composer" => "Composer",
"conductor" => "Conductor", "conductor" => "Conductor",
"copyright" => "Copyright",
"artist_name" => "Creator", "artist_name" => "Creator",
"disc_number" => "Disc Number", "encoded_by" => "Encoded By",
"genre" => "Genre", "genre" => "Genre",
"isrc_number" => "ISRC", "isrc_number" => "ISRC",
"label" => "Label", "label" => "Label",
@ -18,44 +18,44 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
"mtime" => "Last Modified", "mtime" => "Last Modified",
"lptime" => "Last Played", "lptime" => "Last Played",
"length" => "Length", "length" => "Length",
"lyricist" => "Lyricist", "mime" => "Mime",
"mood" => "Mood", "mood" => "Mood",
"name" => "Name", "owner_id" => "Owner",
"orchestra" => "Orchestra", "replay_gain" => "Replay Gain",
"rating" => "Rating",
"sample_rate" => "Sample Rate (kHz)", "sample_rate" => "Sample Rate (kHz)",
"track_title" => "Title", "track_title" => "Title",
"track_number" => "Track Number", "track_number" => "Track Number",
"utime" => "Uploaded", "utime" => "Uploaded",
"info_url" => "Website",
"year" => "Year" "year" => "Year"
); );
private $criteriaTypes = array( private $criteriaTypes = array(
0 => "", 0 => "",
"album_title" => "s", "album_title" => "s",
"artist_name" => "s",
"bit_rate" => "n", "bit_rate" => "n",
"bpm" => "n", "bpm" => "n",
"comments" => "s",
"composer" => "s", "composer" => "s",
"conductor" => "s", "conductor" => "s",
"copyright" => "s",
"artist_name" => "s",
"encoded_by" => "s",
"utime" => "n", "utime" => "n",
"mtime" => "n", "mtime" => "n",
"lptime" => "n", "lptime" => "n",
"disc_number" => "n",
"genre" => "s", "genre" => "s",
"isrc_number" => "s", "isrc_number" => "s",
"label" => "s", "label" => "s",
"language" => "s", "language" => "s",
"length" => "n", "length" => "n",
"lyricist" => "s", "mime" => "s",
"mood" => "s", "mood" => "s",
"name" => "s", "owner_id" => "s",
"orchestra" => "s", "replay_gain" => "n",
"rating" => "n",
"sample_rate" => "n", "sample_rate" => "n",
"track_title" => "s", "track_title" => "s",
"track_number" => "n", "track_number" => "n",
"info_url" => "s",
"year" => "n" "year" => "n"
); );
@ -382,23 +382,23 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
"artist_name" => "DbArtistName", "artist_name" => "DbArtistName",
"bit_rate" => "DbBitRate", "bit_rate" => "DbBitRate",
"bpm" => "DbBpm", "bpm" => "DbBpm",
"comments" => "DbComments",
"composer" => "DbComposer", "composer" => "DbComposer",
"conductor" => "DbConductor", "conductor" => "DbConductor",
"copyright" => "DbCopyright",
"encoded_by" => "DbEncodedBy",
"utime" => "DbUtime", "utime" => "DbUtime",
"mtime" => "DbMtime", "mtime" => "DbMtime",
"lptime" => "DbLPtime", "lptime" => "DbLPtime",
"disc_number" => "DbDiscNumber",
"genre" => "DbGenre", "genre" => "DbGenre",
"info_url" => "DbInfoUrl",
"isrc_number" => "DbIsrcNumber", "isrc_number" => "DbIsrcNumber",
"label" => "DbLabel", "label" => "DbLabel",
"language" => "DbLanguage", "language" => "DbLanguage",
"length" => "DbLength", "length" => "DbLength",
"lyricist" => "DbLyricist", "mime" => "DbMime",
"mood" => "DbMood", "mood" => "DbMood",
"name" => "DbName", "owner_id" => "DbOwnerId",
"orchestra" => "DbOrchestra", "replay_gain" => "DbReplayGain",
"rating" => "DbRating",
"sample_rate" => "DbSampleRate", "sample_rate" => "DbSampleRate",
"track_title" => "DbTrackTitle", "track_title" => "DbTrackTitle",
"track_number" => "DbTrackNumber", "track_number" => "DbTrackNumber",
@ -411,8 +411,6 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
// 3. validate formate according to DB column type // 3. validate formate according to DB column type
$multiplier = 1; $multiplier = 1;
$result = 0; $result = 0;
$errors = array();
$error = array();
// validation start // validation start
if ($data['etc']['sp_limit_options'] == 'hours') { if ($data['etc']['sp_limit_options'] == 'hours') {
@ -444,8 +442,6 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
} }
} }
$criteriaFieldsUsed = array();
if (isset($data['criteria'])) { if (isset($data['criteria'])) {
foreach ($data['criteria'] as $rowKey=>$row) { foreach ($data['criteria'] as $rowKey=>$row) {
foreach ($row as $key=>$d) { foreach ($row as $key=>$d) {
@ -489,7 +485,8 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
} }
} }
} }
} elseif ($column->getType() == PropelColumnTypes::INTEGER) { } elseif ($column->getType() == PropelColumnTypes::INTEGER &&
$d['sp_criteria_field'] != 'owner_id') {
if (!is_numeric($d['sp_criteria_value'])) { if (!is_numeric($d['sp_criteria_value'])) {
$element->addError("The value has to be numeric"); $element->addError("The value has to be numeric");
$isValid = false; $isValid = false;

View File

@ -26,61 +26,61 @@ class Application_Model_Block implements Application_Model_LibraryEditable
* info needed to insert a new block element. * info needed to insert a new block element.
*/ */
private $blockItem = array( private $blockItem = array(
"id" => "", "id" => "",
"pos" => "", "pos" => "",
"cliplength" => "", "cliplength" => "",
"cuein" => "00:00:00", "cuein" => "00:00:00",
"cueout" => "00:00:00", "cueout" => "00:00:00",
"fadein" => "0.0", "fadein" => "0.0",
"fadeout" => "0.0", "fadeout" => "0.0",
); );
//using propel's phpNames. //using propel's phpNames.
private $categories = array( private $categories = array(
"dc:title" => "Name", "dc:title" => "Name",
"dc:creator" => "Creator", "dc:creator" => "Creator",
"dc:description" => "Description", "dc:description" => "Description",
"dcterms:extent" => "Length" "dcterms:extent" => "Length"
); );
private static $modifier2CriteriaMap = array( private static $modifier2CriteriaMap = array(
"contains" => Criteria::ILIKE, "contains" => Criteria::ILIKE,
"does not contain" => Criteria::NOT_ILIKE, "does not contain" => Criteria::NOT_ILIKE,
"is" => Criteria::EQUAL, "is" => Criteria::EQUAL,
"is not" => Criteria::NOT_EQUAL, "is not" => Criteria::NOT_EQUAL,
"starts with" => Criteria::ILIKE, "starts with" => Criteria::ILIKE,
"ends with" => Criteria::ILIKE, "ends with" => Criteria::ILIKE,
"is greater than" => Criteria::GREATER_THAN, "is greater than" => Criteria::GREATER_THAN,
"is less than" => Criteria::LESS_THAN, "is less than" => Criteria::LESS_THAN,
"is in the range" => Criteria::CUSTOM); "is in the range" => Criteria::CUSTOM);
private static $criteria2PeerMap = array( private static $criteria2PeerMap = array(
0 => "Select criteria", 0 => "Select criteria",
"album_title" => "DbAlbumTitle", "album_title" => "DbAlbumTitle",
"artist_name" => "DbArtistName", "artist_name" => "DbArtistName",
"bit_rate" => "DbBitRate", "bit_rate" => "DbBitRate",
"bpm" => "DbBpm", "bpm" => "DbBpm",
"comments" => "DbComments", "composer" => "DbComposer",
"composer" => "DbComposer", "conductor" => "DbConductor",
"conductor" => "DbConductor", "copyright" => "DbCopyright",
"utime" => "DbUtime", "encoded_by" => "DbEncodedBy",
"mtime" => "DbMtime", "utime" => "DbUtime",
"lptime" => "DbLPtime", "mtime" => "DbMtime",
"disc_number" => "DbDiscNumber", "lptime" => "DbLPtime",
"genre" => "DbGenre", "genre" => "DbGenre",
"isrc_number" => "DbIsrcNumber", "info_url" => "DbInfoUrl",
"label" => "DbLabel", "isrc_number" => "DbIsrcNumber",
"language" => "DbLanguage", "label" => "DbLabel",
"length" => "DbLength", "language" => "DbLanguage",
"lyricist" => "DbLyricist", "length" => "DbLength",
"mood" => "DbMood", "mime" => "DbMime",
"name" => "DbName", "mood" => "DbMood",
"orchestra" => "DbOrchestra", "owner_id" => "DbOwnerId",
"rating" => "DbRating", "replay_gain" => "DbReplayGain",
"sample_rate" => "DbSampleRate", "sample_rate" => "DbSampleRate",
"track_title" => "DbTrackTitle", "track_title" => "DbTrackTitle",
"track_number" => "DbTrackNumber", "track_number" => "DbTrackNumber",
"year" => "DbYear" "year" => "DbYear"
); );
public function __construct($id=null, $con=null) public function __construct($id=null, $con=null)
@ -189,16 +189,29 @@ class Application_Model_Block implements Application_Model_LibraryEditable
public function getContents($filterFiles=false) public function getContents($filterFiles=false)
{ {
Logging::info("Getting contents for block {$this->id}"); Logging::info("Getting contents for block {$this->id}");
$files = array(); $sql = <<<SQL
$sql = <<<"EOT" SELECT pc.id AS id,
SELECT pc.id as id, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout, bl.type, f.length as orig_length, pc.position,
f.id as item_id, f.track_title, f.artist_name as creator, f.file_exists as exists, f.filepath as path FROM cc_blockcontents AS pc pc.cliplength AS LENGTH,
LEFT JOIN cc_files AS f ON pc.file_id=f.id pc.cuein,
LEFT JOIN cc_block AS bl ON pc.block_id = bl.id pc.cueout,
WHERE pc.block_id = :block_id pc.fadein,
ORDER BY pc.position; pc.fadeout,
EOT; bl.type,
f.LENGTH AS orig_length,
f.id AS item_id,
f.track_title,
f.artist_name AS creator,
f.file_exists AS EXISTS,
f.filepath AS path,
f.mime as mime
FROM cc_blockcontents AS pc
LEFT JOIN cc_files AS f ON pc.file_id=f.id
LEFT JOIN cc_block AS bl ON pc.block_id = bl.id
WHERE pc.block_id = :block_id
ORDER BY pc.position
SQL;
$rows = Application_Common_Database::prepareAndExecute($sql, array(':block_id'=>$this->id)); $rows = Application_Common_Database::prepareAndExecute($sql, array(':block_id'=>$this->id));
@ -290,20 +303,20 @@ EOT;
$hour = "00"; $hour = "00";
if ($modifier == "minutes") { if ($modifier == "minutes") {
if ($value >59) { if ($value >59) {
$hour = intval($value/60); $hour = intval($value/60);
$value = $value%60; $value = $value%60;
} }
} elseif ($modifier == "hours") { } elseif ($modifier == "hours") {
$mins = $value * 60; $mins = $value * 60;
if ($mins >59) { if ($mins >59) {
$hour = intval($mins/60); $hour = intval($mins/60);
$hour = str_pad($hour, 2, "0", STR_PAD_LEFT); $hour = str_pad($hour, 2, "0", STR_PAD_LEFT);
$value = $mins%60; $value = $mins%60;
} }
} }
$hour = str_pad($hour, 2, "0", STR_PAD_LEFT); $hour = str_pad($hour, 2, "0", STR_PAD_LEFT);
$value = str_pad($value, 2, "0", STR_PAD_LEFT); $value = str_pad($value, 2, "0", STR_PAD_LEFT);
$length = $hour.":".$value.":00"; $length = $hour.":".$value.":00";
} }
@ -315,7 +328,7 @@ EOT;
$result = CcBlockcriteriaQuery::create()->filterByDbBlockId($this->id) $result = CcBlockcriteriaQuery::create()->filterByDbBlockId($this->id)
->filterByDbCriteria('limit')->findOne(); ->filterByDbCriteria('limit')->findOne();
$modifier = $result->getDbModifier(); $modifier = $result->getDbModifier();
$value = $result->getDbValue(); $value = $result->getDbValue();
return array($value, $modifier); return array($value, $modifier);
} }
@ -323,10 +336,12 @@ EOT;
// this function returns sum of all track length under this block. // this function returns sum of all track length under this block.
public function getStaticLength() public function getStaticLength()
{ {
$sql = "SELECT SUM(cliplength) as length FROM cc_blockcontents WHERE block_id = :block_id"; $sql = <<<SQL
SELECT SUM(cliplength) AS LENGTH
FROM cc_blockcontents
WHERE block_id = :block_id
SQL;
$result = Application_Common_Database::prepareAndExecute($sql, array(':block_id'=>$this->id), 'all', PDO::FETCH_NUM); $result = Application_Common_Database::prepareAndExecute($sql, array(':block_id'=>$this->id), 'all', PDO::FETCH_NUM);
Logging::info($result);
return $result[0][0]; return $result[0][0];
} }
@ -357,11 +372,11 @@ EOT;
$file = CcFilesQuery::create()->findPK($p_item, $this->con); $file = CcFilesQuery::create()->findPK($p_item, $this->con);
if (isset($file) && $file->getDbFileExists()) { if (isset($file) && $file->getDbFileExists()) {
$entry = $this->blockItem; $entry = $this->blockItem;
$entry["id"] = $file->getDbId(); $entry["id"] = $file->getDbId();
$entry["pos"] = $pos; $entry["pos"] = $pos;
$entry["cliplength"] = $file->getDbLength(); $entry["cliplength"] = $file->getDbLength();
$entry["cueout"] = $file->getDbLength(); $entry["cueout"] = $file->getDbLength();
return $entry; return $entry;
} else { } else {
@ -624,8 +639,6 @@ EOT;
$this->con->beginTransaction(); $this->con->beginTransaction();
$errArray= array();
try { try {
$row = CcBlockcontentsQuery::create()->findPK($id); $row = CcBlockcontentsQuery::create()->findPK($id);
@ -736,10 +749,10 @@ EOT;
throw new Exception("Block item does not exist."); throw new Exception("Block item does not exist.");
} }
$oldCueIn = $row->getDBCuein(); $oldCueIn = $row->getDBCuein();
$oldCueOut = $row->getDbCueout(); $oldCueOut = $row->getDbCueout();
$fadeIn = $row->getDbFadein(); $fadeIn = $row->getDbFadein();
$fadeOut = $row->getDbFadeout(); $fadeOut = $row->getDbFadeout();
$file = $row->getCcFiles($this->con); $file = $row->getCcFiles($this->con);
$origLength = $file->getDbLength(); $origLength = $file->getDbLength();
@ -1014,8 +1027,7 @@ EOT;
$blockType = $data['etc']['sp_type'] == 0 ? 'static':'dynamic'; $blockType = $data['etc']['sp_type'] == 0 ? 'static':'dynamic';
$this->saveType($blockType); $this->saveType($blockType);
$this->storeCriteriaIntoDb($data); $this->storeCriteriaIntoDb($data);
//get number of files that meet the criteria
$files = $this->getListofFilesMeetCriteria();
// if the block is dynamic, put null to the length // if the block is dynamic, put null to the length
// as it cannot be calculated // as it cannot be calculated
if ($blockType == 'dynamic') { if ($blockType == 'dynamic') {
@ -1038,18 +1050,14 @@ EOT;
public function hasItemLimit() public function hasItemLimit()
{ {
list($value, $modifier) = $this->getLimitValueAndModifier(); list($value, $modifier) = $this->getLimitValueAndModifier();
if ($modifier == 'items') { return ($modifier == 'items');
return true;
} else {
return false;
}
} }
public function storeCriteriaIntoDb($p_criteriaData) public function storeCriteriaIntoDb($p_criteriaData)
{ {
// delete criteria under $p_blockId // delete criteria under $p_blockId
CcBlockcriteriaQuery::create()->findByDbBlockId($this->id)->delete(); CcBlockcriteriaQuery::create()->findByDbBlockId($this->id)->delete();
Logging::info($p_criteriaData); //Logging::info($p_criteriaData);
//insert modifier rows //insert modifier rows
if (isset($p_criteriaData['criteria'])) { if (isset($p_criteriaData['criteria'])) {
$critKeys = array_keys($p_criteriaData['criteria']); $critKeys = array_keys($p_criteriaData['criteria']);
@ -1114,12 +1122,12 @@ EOT;
public function getListOfFilesUnderLimit() public function getListOfFilesUnderLimit()
{ {
$info = $this->getListofFilesMeetCriteria(); $info = $this->getListofFilesMeetCriteria();
$files = $info['files']; $files = $info['files'];
$limit = $info['limit']; $limit = $info['limit'];
$insertList = array(); $insertList = array();
$totalTime = 0; $totalTime = 0;
$totalItems = 0; $totalItems = 0;
// this moves the pointer to the first element in the collection // this moves the pointer to the first element in the collection
@ -1145,32 +1153,32 @@ EOT;
public function getCriteria() public function getCriteria()
{ {
$criteriaOptions = array( $criteriaOptions = array(
0 => "Select criteria", 0 => "Select criteria",
"album_title" => "Album", "album_title" => "Album",
"bit_rate" => "Bit Rate", "bit_rate" => "Bit Rate (Kbps)",
"bpm" => "Bpm", "bpm" => "BPM",
"comments" => "Comments", "composer" => "Composer",
"composer" => "Composer", "conductor" => "Conductor",
"conductor" => "Conductor", "copyright" => "Copyright",
"artist_name" => "Creator", "artist_name" => "Creator",
"disc_number" => "Disc Number", "encoded_by" => "Encoded By",
"genre" => "Genre", "genre" => "Genre",
"isrc_number" => "ISRC", "isrc_number" => "ISRC",
"label" => "Label", "label" => "Label",
"language" => "Language", "language" => "Language",
"mtime" => "Last Modified", "mtime" => "Last Modified",
"lptime" => "Last Played", "lptime" => "Last Played",
"length" => "Length", "length" => "Length",
"lyricist" => "Lyricist", "mime" => "Mime",
"mood" => "Mood", "mood" => "Mood",
"name" => "Name", "owner_id" => "Owner",
"orchestra" => "Orchestra", "replay_gain" => "Replay Gain",
"rating" => "Rating", "sample_rate" => "Sample Rate (kHz)",
"sample_rate" => "Sample Rate", "track_title" => "Title",
"track_title" => "Title",
"track_number" => "Track Number", "track_number" => "Track Number",
"utime" => "Uploaded", "utime" => "Uploaded",
"year" => "Year" "info_url" => "Website",
"year" => "Year"
); );
// Load criteria from db // Load criteria from db
@ -1200,12 +1208,13 @@ EOT;
$storedCrit = $this->getCriteria(); $storedCrit = $this->getCriteria();
$qry = CcFilesQuery::create(); $qry = CcFilesQuery::create();
$qry->useFkOwnerQuery("subj", "left join");
if (isset($storedCrit["crit"])) { if (isset($storedCrit["crit"])) {
foreach ($storedCrit["crit"] as $crit) { foreach ($storedCrit["crit"] as $crit) {
$i = 0; $i = 0;
foreach ($crit as $criteria) { foreach ($crit as $criteria) {
$spCriteriaPhpName = self::$criteria2PeerMap[$criteria['criteria']]; //$spCriteriaPhpName = self::$criteria2PeerMap[$criteria['criteria']];
$spCriteria = $criteria['criteria']; $spCriteria = $criteria['criteria'];
$spCriteriaModifier = $criteria['modifier']; $spCriteriaModifier = $criteria['modifier'];
@ -1274,6 +1283,9 @@ EOT;
$spCriteriaModifier = self::$modifier2CriteriaMap[$spCriteriaModifier]; $spCriteriaModifier = self::$modifier2CriteriaMap[$spCriteriaModifier];
try { try {
if ($spCriteria == "owner_id") {
$spCriteria = "subj.login";
}
if ($i > 0) { if ($i > 0) {
$qry->addOr($spCriteria, $spCriteriaValue, $spCriteriaModifier); $qry->addOr($spCriteria, $spCriteriaValue, $spCriteriaModifier);
} else { } else {
@ -1344,7 +1356,6 @@ EOT;
} }
if (in_array($fieldName, $fieldNames)) { if (in_array($fieldName, $fieldNames)) {
$rowNum = intval(substr($ele['name'], $index+1));
$output['criteria'][$critIndex][$lastChar][$fieldName] = trim($ele['value']); $output['criteria'][$critIndex][$lastChar][$fieldName] = trim($ele['value']);
} else { } else {
$output['etc'][$ele['name']] = $ele['value']; $output['etc'][$ele['name']] = $ele['value'];

View File

@ -116,7 +116,6 @@ class Application_Model_Datatables
$simpleWhere = array(); $simpleWhere = array();
foreach ($searchTerms as $term) { foreach ($searchTerms as $term) {
$innerCond = array();
foreach ($searchCols as $col) { foreach ($searchCols as $col) {
$simpleWhere['clause']["simple_".$col] = "{$col}::text ILIKE :simple_".$col; $simpleWhere['clause']["simple_".$col] = "{$col}::text ILIKE :simple_".$col;

View File

@ -20,7 +20,7 @@ class Application_Model_Email
$mailServer = Application_Model_Preference::GetMailServer(); $mailServer = Application_Model_Preference::GetMailServer();
$mailServerPort = Application_Model_Preference::GetMailServerPort(); $mailServerPort = Application_Model_Preference::GetMailServerPort();
if (!empty($mailServerPort)) { if (!empty($mailServerPort)) {
$port = Application_Model_Preference::GetMailServerPort(); $port = $mailServerPort;
} }
if ($mailServerRequiresAuth) { if ($mailServerRequiresAuth) {

View File

@ -75,7 +75,6 @@ class Application_Model_MusicDir
*/ */
public function remove($userAddedWatchedDir=true) public function remove($userAddedWatchedDir=true)
{ {
$con = Propel::getConnection();
$music_dir_id = $this->getId(); $music_dir_id = $this->getId();

View File

@ -154,7 +154,6 @@ class Application_Model_Playlist implements Application_Model_LibraryEditable
public function getContents($filterFiles=false) public function getContents($filterFiles=false)
{ {
Logging::info("Getting contents for playlist {$this->id}"); Logging::info("Getting contents for playlist {$this->id}");
$files = array();
$sql = <<<SQL $sql = <<<SQL
SELECT * SELECT *
@ -172,7 +171,8 @@ class Application_Model_Playlist implements Application_Model_LibraryEditable
f.artist_name AS creator, f.artist_name AS creator,
f.file_exists AS EXISTS, f.file_exists AS EXISTS,
f.filepath AS path, f.filepath AS path,
f.length AS orig_length f.length AS orig_length,
f.mime AS mime
FROM cc_playlistcontents AS pc FROM cc_playlistcontents AS pc
JOIN cc_files AS f ON pc.file_id=f.id JOIN cc_files AS f ON pc.file_id=f.id
WHERE pc.playlist_id = :playlist_id1 WHERE pc.playlist_id = :playlist_id1
@ -190,7 +190,8 @@ class Application_Model_Playlist implements Application_Model_LibraryEditable
sub.login AS creator, sub.login AS creator,
't'::boolean AS EXISTS, 't'::boolean AS EXISTS,
ws.url AS path, ws.url AS path,
ws.length AS orig_length ws.length AS orig_length,
ws.mime as mime
FROM cc_playlistcontents AS pc FROM cc_playlistcontents AS pc
JOIN cc_webstream AS ws ON pc.stream_id=ws.id JOIN cc_webstream AS ws ON pc.stream_id=ws.id
LEFT JOIN cc_subjs AS sub ON sub.id = ws.creator_id LEFT JOIN cc_subjs AS sub ON sub.id = ws.creator_id
@ -209,7 +210,8 @@ class Application_Model_Playlist implements Application_Model_LibraryEditable
sbj.login AS creator, sbj.login AS creator,
't'::boolean AS EXISTS, 't'::boolean AS EXISTS,
NULL::text AS path, NULL::text AS path,
bl.length AS orig_length bl.length AS orig_length,
NULL::text as mime
FROM cc_playlistcontents AS pc FROM cc_playlistcontents AS pc
JOIN cc_block AS bl ON pc.block_id=bl.id JOIN cc_block AS bl ON pc.block_id=bl.id
JOIN cc_subjs AS sbj ON bl.creator_id=sbj.id JOIN cc_subjs AS sbj ON bl.creator_id=sbj.id
@ -611,8 +613,6 @@ SQL;
$this->con->beginTransaction(); $this->con->beginTransaction();
$errArray= array();
try { try {
$row = CcPlaylistcontentsQuery::create()->findPK($id); $row = CcPlaylistcontentsQuery::create()->findPK($id);

View File

@ -6,8 +6,6 @@ class Application_Model_Preference
public static function setValue($key, $value, $isUserValue = false) public static function setValue($key, $value, $isUserValue = false)
{ {
try { try {
$con = Propel::getConnection();
//called from a daemon process //called from a daemon process
if (!class_exists("Zend_Auth", false) || !Zend_Auth::getInstance()->hasIdentity()) { if (!class_exists("Zend_Auth", false) || !Zend_Auth::getInstance()->hasIdentity()) {
$id = NULL; $id = NULL;
@ -425,7 +423,6 @@ class Application_Model_Preference
{ {
self::setValue("timezone", $timezone); self::setValue("timezone", $timezone);
date_default_timezone_set($timezone); date_default_timezone_set($timezone);
$md = array("timezone" => $timezone);
} }
public static function GetTimezone() public static function GetTimezone()

View File

@ -10,10 +10,14 @@ class Application_Model_Schedule
public function IsFileScheduledInTheFuture($p_fileId) public function IsFileScheduledInTheFuture($p_fileId)
{ {
global $CC_CONFIG; global $CC_CONFIG;
$sql = "SELECT COUNT(*) FROM ".$CC_CONFIG["scheduleTable"] $sql = <<<SQL
." WHERE file_id = :file_id AND ends > NOW() AT TIME ZONE 'UTC'"; SELECT COUNT(*)
$count = Application_Common_Database::prepareAndExecute($sql, array(':file_id'=>$p_fileId), 'column'); FROM cc_schedule
WHERE file_id = :file_id
AND ends > NOW() AT TIME ZONE 'UTC'
SQL;
$count = Application_Common_Database::prepareAndExecute( $sql, array(
':file_id'=>$p_fileId), 'column');
return (is_numeric($count) && ($count != '0')); return (is_numeric($count) && ($count != '0'));
} }
@ -71,7 +75,6 @@ class Application_Model_Schedule
return; return;
} }
$con = Propel::getConnection();
$sql = "SELECT %%columns%% st.starts as starts, st.ends as ends, $sql = "SELECT %%columns%% st.starts as starts, st.ends as ends,
st.media_item_played as media_item_played, si.ends as show_ends st.media_item_played as media_item_played, si.ends as show_ends
%%tables%% WHERE "; %%tables%% WHERE ";
@ -177,7 +180,7 @@ SELECT ft.artist_name,
ft.track_title, ft.track_title,
st.starts AS starts, st.starts AS starts,
st.ends AS ends st.ends AS ends
FROM $CC_CONFIG[scheduleTable] st FROM cc_schedule st
LEFT JOIN $CC_CONFIG[filesTable] ft ON st.file_id = ft.id LEFT JOIN $CC_CONFIG[filesTable] ft ON st.file_id = ft.id
LEFT JOIN $CC_CONFIG[showInstances] sit ON st.instance_id = sit.id LEFT JOIN $CC_CONFIG[showInstances] sit ON st.instance_id = sit.id
-- this and the next line are necessary since we can overbook shows. -- this and the next line are necessary since we can overbook shows.
@ -374,14 +377,19 @@ SQL;
public static function UpdateBrodcastedStatus($dateTime, $value) public static function UpdateBrodcastedStatus($dateTime, $value)
{ {
global $CC_CONFIG;
$con = Propel::getConnection();
$now = $dateTime->format("Y-m-d H:i:s"); $now = $dateTime->format("Y-m-d H:i:s");
$sql = "UPDATE ".$CC_CONFIG['scheduleTable']
." SET broadcasted=$value"
." WHERE starts <= '$now' AND ends >= '$now'";
$retVal = $con->exec($sql);
$sql = <<<SQL
UPDATE cc_schedule
SET broadcasted=:broadcastedValue
WHERE starts <= :starts::TIMESTAMP
AND ends >= :ends::TIMESTAMP
SQL;
$retVal = Application_Common_Database::prepareAndExecute($sql, array(
':broadcastedValue' => $value,
':starts' => $now,
':ends' => $now), 'execute');
return $retVal; return $retVal;
} }
@ -514,61 +522,63 @@ SQL;
*/ */
public static function getItems($p_startTime, $p_endTime) public static function getItems($p_startTime, $p_endTime)
{ {
global $CC_CONFIG; $baseQuery = <<<SQL
SELECT st.file_id AS file_id,
st.id AS id,
st.instance_id AS instance_id,
st.starts AS start,
st.ends AS end,
st.cue_in AS cue_in,
st.cue_out AS cue_out,
st.fade_in AS fade_in,
st.fade_out AS fade_out,
si.starts AS show_start,
si.ends AS show_end,
s.name AS show_name,
f.id AS file_id,
f.replay_gain AS replay_gain,
ws.id AS stream_id,
ws.url AS url
FROM cc_schedule AS st
LEFT JOIN cc_show_instances AS si ON st.instance_id = si.id
LEFT JOIN cc_show AS s ON s.id = si.show_id
LEFT JOIN cc_files AS f ON st.file_id = f.id
LEFT JOIN cc_webstream AS ws ON st.stream_id = ws.id
SQL;
$predicates = <<<SQL
WHERE st.ends > :startTime1
AND st.starts < :endTime
AND st.playout_status > 0
AND si.ends > :startTime2
ORDER BY st.starts
SQL;
$baseQuery = "SELECT st.file_id AS file_id," $sql = $baseQuery." ".$predicates;
." st.id AS id,"
." st.instance_id AS instance_id,"
." st.starts AS start,"
." st.ends AS end,"
." st.cue_in AS cue_in,"
." st.cue_out AS cue_out,"
." st.fade_in AS fade_in,"
." st.fade_out AS fade_out,"
//." st.type AS type,"
." si.starts AS show_start,"
." si.ends AS show_end,"
." s.name AS show_name,"
." f.id AS file_id,"
." f.replay_gain AS replay_gain,"
." ws.id as stream_id,"
." ws.url as url"
." FROM cc_schedule AS st"
." LEFT JOIN cc_show_instances AS si"
." ON st.instance_id = si.id"
." LEFT JOIN cc_show as s"
." ON s.id = si.show_id"
." LEFT JOIN cc_files AS f"
." ON st.file_id = f.id"
." LEFT JOIN cc_webstream AS ws"
." ON st.stream_id = ws.id";
$predicates = " WHERE st.ends > :startTime1" $rows = Application_Common_Database::prepareAndExecute($sql, array(
." AND st.starts < :endTime" ':startTime1' => $p_startTime,
." AND st.playout_status > 0" ':endTime' => $p_endTime,
." AND si.ends > :startTime2" ':startTime2' => $p_startTime));
." ORDER BY st.starts";
$sql = $baseQuery.$predicates;
$rows = Application_Common_Database::prepareAndExecute($sql,
array(':startTime1'=>$p_startTime, ':endTime'=>$p_endTime, ':startTime2'=>$p_startTime));
if (count($rows) < 3) { if (count($rows) < 3) {
$dt = new DateTime("@".time()); $dt = new DateTime("@".time());
$dt->add(new DateInterval("PT24H")); $dt->add(new DateInterval("PT24H"));
$range_end = $dt->format("Y-m-d H:i:s"); $range_end = $dt->format("Y-m-d H:i:s");
$predicates = " WHERE st.ends > :startTime1" $predicates = <<<SQL
." AND st.starts < :rangeEnd" WHERE st.ends > :startTime1
." AND st.playout_status > 0" AND st.starts < :rangeEnd
." AND si.ends > :startTime2" AND st.playout_status > 0
." ORDER BY st.starts" AND si.ends > :startTime2
." LIMIT 3"; ORDER BY st.starts LIMIT 3
SQL;
$sql = $baseQuery.$predicates; $sql = $baseQuery." ".$predicates." ";
$rows = Application_Common_Database::prepareAndExecute($sql, $rows = Application_Common_Database::prepareAndExecute($sql,
array(':startTime1'=>$p_startTime, ':rangeEnd'=>$range_end, ':startTime2'=>$p_startTime)); array(
':startTime1' => $p_startTime,
':rangeEnd' => $range_end,
':startTime2' => $p_startTime));
} }
return $rows; return $rows;
@ -626,21 +636,21 @@ SQL;
private static function createFileScheduleEvent(&$data, $item, $media_id, $uri) private static function createFileScheduleEvent(&$data, $item, $media_id, $uri)
{ {
$start = self::AirtimeTimeToPypoTime($item["start"]); $start = self::AirtimeTimeToPypoTime($item["start"]);
$end = self::AirtimeTimeToPypoTime($item["end"]); $end = self::AirtimeTimeToPypoTime($item["end"]);
$schedule_item = array( $schedule_item = array(
'id' => $media_id, 'id' => $media_id,
'type' => 'file', 'type' => 'file',
'row_id' => $item["id"], 'row_id' => $item["id"],
'uri' => $uri, 'uri' => $uri,
'fade_in' => Application_Model_Schedule::WallTimeToMillisecs($item["fade_in"]), 'fade_in' => Application_Model_Schedule::WallTimeToMillisecs($item["fade_in"]),
'fade_out' => Application_Model_Schedule::WallTimeToMillisecs($item["fade_out"]), 'fade_out' => Application_Model_Schedule::WallTimeToMillisecs($item["fade_out"]),
'cue_in' => Application_Common_DateHelper::CalculateLengthInSeconds($item["cue_in"]), 'cue_in' => Application_Common_DateHelper::CalculateLengthInSeconds($item["cue_in"]),
'cue_out' => Application_Common_DateHelper::CalculateLengthInSeconds($item["cue_out"]), 'cue_out' => Application_Common_DateHelper::CalculateLengthInSeconds($item["cue_out"]),
'start' => $start, 'start' => $start,
'end' => $end, 'end' => $end,
'show_name' => $item["show_name"], 'show_name' => $item["show_name"],
'replay_gain' => is_null($item["replay_gain"]) ? "0": $item["replay_gain"], 'replay_gain' => is_null($item["replay_gain"]) ? "0": $item["replay_gain"],
'independent_event' => true 'independent_event' => true
); );
self::appendScheduleItem($data, $start, $schedule_item); self::appendScheduleItem($data, $start, $schedule_item);
@ -649,7 +659,7 @@ SQL;
private static function createStreamScheduleEvent(&$data, $item, $media_id, $uri) private static function createStreamScheduleEvent(&$data, $item, $media_id, $uri)
{ {
$start = self::AirtimeTimeToPypoTime($item["start"]); $start = self::AirtimeTimeToPypoTime($item["start"]);
$end = self::AirtimeTimeToPypoTime($item["end"]); $end = self::AirtimeTimeToPypoTime($item["end"]);
//create an event to start stream buffering 5 seconds ahead of the streams actual time. //create an event to start stream buffering 5 seconds ahead of the streams actual time.
$buffer_start = new DateTime($item["start"], new DateTimeZone('UTC')); $buffer_start = new DateTime($item["start"], new DateTimeZone('UTC'));
@ -658,24 +668,24 @@ SQL;
$stream_buffer_start = self::AirtimeTimeToPypoTime($buffer_start->format("Y-m-d H:i:s")); $stream_buffer_start = self::AirtimeTimeToPypoTime($buffer_start->format("Y-m-d H:i:s"));
$schedule_item = array( $schedule_item = array(
'start' => $stream_buffer_start, 'start' => $stream_buffer_start,
'end' => $stream_buffer_start, 'end' => $stream_buffer_start,
'uri' => $uri, 'uri' => $uri,
'row_id' => $item["id"], 'row_id' => $item["id"],
'type' => 'stream_buffer_start', 'type' => 'stream_buffer_start',
'independent_event' => true 'independent_event' => true
); );
self::appendScheduleItem($data, $start, $schedule_item); self::appendScheduleItem($data, $start, $schedule_item);
$schedule_item = array( $schedule_item = array(
'id' => $media_id, 'id' => $media_id,
'type' => 'stream_output_start', 'type' => 'stream_output_start',
'row_id' => $item["id"], 'row_id' => $item["id"],
'uri' => $uri, 'uri' => $uri,
'start' => $start, 'start' => $start,
'end' => $end, 'end' => $end,
'show_name' => $item["show_name"], 'show_name' => $item["show_name"],
'independent_event' => true 'independent_event' => true
); );
self::appendScheduleItem($data, $start, $schedule_item); self::appendScheduleItem($data, $start, $schedule_item);
@ -688,19 +698,19 @@ SQL;
$stream_end = self::AirtimeTimeToPypoTime($dt->format("Y-m-d H:i:s")); $stream_end = self::AirtimeTimeToPypoTime($dt->format("Y-m-d H:i:s"));
$schedule_item = array( $schedule_item = array(
'start' => $stream_end, 'start' => $stream_end,
'end' => $stream_end, 'end' => $stream_end,
'uri' => $uri, 'uri' => $uri,
'type' => 'stream_buffer_end', 'type' => 'stream_buffer_end',
'independent_event' => true 'independent_event' => true
); );
self::appendScheduleItem($data, $stream_end, $schedule_item); self::appendScheduleItem($data, $stream_end, $schedule_item);
$schedule_item = array( $schedule_item = array(
'start' => $stream_end, 'start' => $stream_end,
'end' => $stream_end, 'end' => $stream_end,
'uri' => $uri, 'uri' => $uri,
'type' => 'stream_output_end', 'type' => 'stream_output_end',
'independent_event' => true 'independent_event' => true
); );
self::appendScheduleItem($data, $stream_end, $schedule_item); self::appendScheduleItem($data, $stream_end, $schedule_item);
@ -710,8 +720,8 @@ SQL;
{ {
global $CC_CONFIG; global $CC_CONFIG;
/* if $p_fromDateTime and $p_toDateTime function parameters are null, then set range /* if $p_fromDateTime and $p_toDateTime function parameters are null,
* from "now" to "now + 24 hours". */ then set range * from "now" to "now + 24 hours". */
if (is_null($p_fromDateTime)) { if (is_null($p_fromDateTime)) {
$t1 = new DateTime("@".time()); $t1 = new DateTime("@".time());
$range_start = $t1->format("Y-m-d H:i:s"); $range_start = $t1->format("Y-m-d H:i:s");
@ -801,7 +811,7 @@ SQL;
{ {
global $CC_CONFIG; global $CC_CONFIG;
$sql = "DELETE FROM ".$CC_CONFIG["scheduleTable"]." WHERE file_id=:file_id"; $sql = "DELETE FROM ".$CC_CONFIG["scheduleTable"]." WHERE file_id=:file_id";
$res = Application_Common_Database::prepareAndExecute($sql, array(':file_id'=>$fileId), 'execute'); Application_Common_Database::prepareAndExecute($sql, array(':file_id'=>$fileId), 'execute');
} }
public static function createNewFormSections($p_view) public static function createNewFormSections($p_view)
@ -942,7 +952,8 @@ SQL;
* Another clean-up is to move all the form manipulation to the proper form class..... * Another clean-up is to move all the form manipulation to the proper form class.....
* -Martin * -Martin
*/ */
public static function addUpdateShow($data, $controller, $validateStartDate, $originalStartDate=null, $update=false, $instanceId=null) public static function addUpdateShow($data, $controller, $validateStartDate,
$originalStartDate=null, $update=false, $instanceId=null)
{ {
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id); $user = new Application_Model_User($userInfo->id);
@ -1076,6 +1087,7 @@ SQL;
} }
} else { } else {
if ($isAdminOrPM) { if ($isAdminOrPM) {
Logging::info( $data );
Application_Model_Show::create($data); Application_Model_Show::create($data);
} }
@ -1086,12 +1098,12 @@ SQL;
return true; return true;
} }
} else { } else {
$controller->view->what = $formWhat; $controller->view->what = $formWhat;
$controller->view->when = $formWhen; $controller->view->when = $formWhen;
$controller->view->repeats = $formRepeats; $controller->view->repeats = $formRepeats;
$controller->view->who = $formWho; $controller->view->who = $formWho;
$controller->view->style = $formStyle; $controller->view->style = $formStyle;
$controller->view->live = $formLive; $controller->view->live = $formLive;
if (!$isSaas) { if (!$isSaas) {
$controller->view->rr = $formRecord; $controller->view->rr = $formRecord;
@ -1104,47 +1116,52 @@ SQL;
} }
} }
public static function checkOverlappingShows($show_start, $show_end, $update=false, $instanceId=null) public static function checkOverlappingShows($show_start, $show_end,
$update=false, $instanceId=null)
{ {
global $CC_CONFIG;
$overlapping = false; $overlapping = false;
$con = Propel::getConnection();
/* If a show is being edited, exclude it from the query /* If a show is being edited, exclude it from the query
* In both cases (new and edit) we only grab shows that * In both cases (new and edit) we only grab shows that
* are scheduled 2 days prior * are scheduled 2 days prior
*/ */
//$se = $show_end->format('Y-m-d H:i:s'); //$se = $show_end->format('Y-m-d H:i:s');
if ($update) { if ($update) {
$stmt = $con->prepare("SELECT id, starts, ends FROM {$CC_CONFIG['showInstances']} $sql = <<<SQL
where (ends <= :show_end1 SELECT id,
or starts <= :show_end2) starts,
and date(starts) >= (date(:show_end3) - INTERVAL '2 days') ends
and modified_instance = false and id != :instanceId order by ends"); FROM cc_show_instances
WHERE (ends <= :show_end1
$stmt->execute(array( OR starts <= :show_end2)
':show_end1' => $show_end->format('Y-m-d H:i:s'), AND date(starts) >= (date(:show_end3) - INTERVAL '2 days')
':show_end2' => $show_end->format('Y-m-d H:i:s'), AND modified_instance = FALSE
':show_end3' => $show_end->format('Y-m-d H:i:s'), AND id != :instanceId
':instanceId' => $instanceId ORDER BY ends
)); SQL;
$rows = Application_Common_Database::prepareAndExecute($sql, array(
':show_end1' => $show_end->format('Y-m-d H:i:s'),
':show_end2' => $show_end->format('Y-m-d H:i:s'),
':show_end3' => $show_end->format('Y-m-d H:i:s'),
':instanceId' => $instanceId
), 'all');
} else { } else {
$stmt = $con->prepare("SELECT id, starts, ends FROM $sql = <<<SQL
{$CC_CONFIG['showInstances']} SELECT id,
where (ends <= :show_end1 or starts <= :show_end2) starts,
and date(starts) >= (date(:show_end3) - INTERVAL '2 days') ends
and modified_instance = false order by ends"); FROM cc_show_instances
WHERE (ends <= :show_end1
OR starts <= :show_end2)
AND date(starts) >= (date(:show_end3) - INTERVAL '2 days')
AND modified_instance = FALSE
ORDER BY ends
SQL;
$stmt->execute(array( $rows = Application_Common_Database::prepareAndExecute($sql, array(
':show_end1' => $show_end->format('Y-m-d H:i:s'), ':show_end1' => $show_end->format('Y-m-d H:i:s'),
':show_end2' => $show_end->format('Y-m-d H:i:s'), ':show_end2' => $show_end->format('Y-m-d H:i:s'),
':show_end3' => $show_end->format('Y-m-d H:i:s') ':show_end3' => $show_end->format('Y-m-d H:i:s')), 'all');
));
} }
$rows = $stmt->fetchAll();
foreach ($rows as $row) { foreach ($rows as $row) {
$start = new DateTime($row["starts"], new DateTimeZone('UTC')); $start = new DateTime($row["starts"], new DateTimeZone('UTC'));
$end = new DateTime($row["ends"], new DateTimeZone('UTC')); $end = new DateTime($row["ends"], new DateTimeZone('UTC'));

View File

@ -613,7 +613,6 @@ class Application_Model_Scheduler
Logging::debug("inserting after removing gaps."); Logging::debug("inserting after removing gaps.");
Logging::debug(floatval($endProfile) - floatval($startProfile)); Logging::debug(floatval($endProfile) - floatval($startProfile));
$afterInstanceId = $afterInstance->getDbId();
$modified = array_keys($modifiedMap); $modified = array_keys($modifiedMap);
//need to adjust shows we have moved items from. //need to adjust shows we have moved items from.
foreach ($modified as $instanceId) { foreach ($modified as $instanceId) {

View File

@ -127,29 +127,31 @@ class Application_Model_Show
public function getHosts() public function getHosts()
{ {
$con = Propel::getConnection(); $sql = <<<SQL
SELECT first_name,
$sql = "SELECT first_name, last_name last_name
FROM cc_show_hosts LEFT JOIN cc_subjs ON cc_show_hosts.subjs_id = cc_subjs.id FROM cc_show_hosts
WHERE show_id = :show_id"; LEFT JOIN cc_subjs ON cc_show_hosts.subjs_id = cc_subjs.id
WHERE show_id = :show_id
SQL;
$hosts = Application_Common_Database::prepareAndExecute( $sql, $hosts = Application_Common_Database::prepareAndExecute( $sql,
array( ':show_id' => $this->getId() ), 'all'); array( ':show_id' => $this->getId() ), 'all');
$res = array_map( function($host) { $res = array();
return $host['first_name']." ".$host['last_name']; foreach ($hosts as $host) {
}, $hosts); $res[] = $host['first_name']." ".$host['last_name'];
}
return $res; return $res;
} }
public function getHostsIds() public function getHostsIds()
{ {
$con = Propel::getConnection(); $sql = <<<SQL
SELECT subjs_id
$sql = "SELECT subjs_id FROM cc_show_hosts
FROM cc_show_hosts WHERE show_id = :show_id
WHERE show_id = :show_id"; SQL;
$hosts = Application_Common_Database::prepareAndExecute( $hosts = Application_Common_Database::prepareAndExecute(
$sql, array( ':show_id' => $this->getId() ), 'all'); $sql, array( ':show_id' => $this->getId() ), 'all');
@ -281,11 +283,16 @@ SQL;
->filterByDbShowId($this->_showId) ->filterByDbShowId($this->_showId)
->update(array('DbLastShow' => $timeinfo[0])); ->update(array('DbLastShow' => $timeinfo[0]));
$sql = "UPDATE cc_show_instances $sql = <<<SQL
SET modified_instance = TRUE UPDATE cc_show_instances
WHERE starts >= '{$day_timestamp}' AND show_id = {$this->_showId}"; SET modified_instance = TRUE
WHERE starts >= :dayTimestamp::TIMESTAMP
AND show_id = :showId
SQL;
$con->exec($sql); Application_Common_Database::prepareAndExecute( $sql, array(
':dayTimestamp' => $day_timestamp,
':showId' => $this->getId()), 'execute');
// check if we can safely delete the show // check if we can safely delete the show
$showInstancesRow = CcShowInstancesQuery::create() $showInstancesRow = CcShowInstancesQuery::create()
@ -294,7 +301,9 @@ SQL;
->findOne(); ->findOne();
if (is_null($showInstancesRow)) { if (is_null($showInstancesRow)) {
$sql = "DELETE FROM cc_show WHERE id = :show_id"; $sql = <<<SQL
DELETE FROM cc_show WHERE id = :show_id
SQL;
Application_Common_Database::prepareAndExecute( Application_Common_Database::prepareAndExecute(
$sql, array( 'show_id' => $this->_showId ), "execute"); $sql, array( 'show_id' => $this->_showId ), "execute");
$con->exec($sql); $con->exec($sql);
@ -318,8 +327,6 @@ SQL;
*/ */
public function removeUncheckedDaysInstances($p_uncheckedDays) public function removeUncheckedDaysInstances($p_uncheckedDays)
{ {
$con = Propel::getConnection();
//need to convert local doftw to UTC doftw (change made for 2.0 since shows are stored in UTC) //need to convert local doftw to UTC doftw (change made for 2.0 since shows are stored in UTC)
$daysRemovedUTC = array(); $daysRemovedUTC = array();
@ -771,7 +778,7 @@ SQL;
$sql = <<<SQL $sql = <<<SQL
SELECT id SELECT id
FROM cc_show_instances FROM cc_show_instances
WHERE show_id :showId WHERE show_id = :showId
AND starts > :timestamp::TIMESTAMP AND starts > :timestamp::TIMESTAMP
AND modified_instance != TRUE AND modified_instance != TRUE
SQL; SQL;
@ -779,9 +786,11 @@ SQL;
array( ':showId' => $this->getId(), array( ':showId' => $this->getId(),
':timestamp' => gmdate("Y-m-d H:i:s")), "all"); ':timestamp' => gmdate("Y-m-d H:i:s")), "all");
return array_map( function($i) { $res = array();
return $i['id']; foreach ($rows as $r) {
}, $rows); $res[] = $r['id'];
}
return $res;
} }
/* Called when a show's duration is changed (edited). /* Called when a show's duration is changed (edited).
@ -879,9 +888,11 @@ SQL;
{ {
$showDays = CcShowDaysQuery::create()->filterByDbShowId( $showDays = CcShowDaysQuery::create()->filterByDbShowId(
$this->getId())->find(); $this->getId())->find();
return array_map( function($showDay) { $res = array();
return $showDay->getDbDay(); foreach ($showDays as $showDay) {
}, $showDays); $res[] = $showDay->getDbDay();
}
return $res;
} }
/* Only used for shows that aren't repeating. /* Only used for shows that aren't repeating.
@ -953,14 +964,14 @@ SQL;
$sql = <<<SQL $sql = <<<SQL
SELECT id SELECT id
FROM cc_show_instances FROM cc_show_instances
WHERE date(starts) = date(TIMESTAMP :timestamp) WHERE date(starts) = date(:timestamp::TIMESTAMP)
AND show_id = :showId AND show_id = :showId
AND rebroadcast = 0; AND rebroadcast = 0;
SQL; SQL;
try { try {
$row = Application_Common_Database::prepareAndExecute( $sql, $row = Application_Common_Database::prepareAndExecute( $sql,
array( 'showId' => $this->getId(), array( ':showId' => $this->getId(),
':timestamp' => $timestamp ), 'column'); ':timestamp' => $timestamp ), 'column');
return CcShowInstancesQuery::create() return CcShowInstancesQuery::create()
->findPk($row); ->findPk($row);
} catch (Exception $e) { } catch (Exception $e) {
@ -1331,13 +1342,10 @@ SQL;
*/ */
private static function populateNonRepeatingShow($p_showRow, $p_populateUntilDateTime) private static function populateNonRepeatingShow($p_showRow, $p_populateUntilDateTime)
{ {
$con = Propel::getConnection();
$show_id = $p_showRow["show_id"]; $show_id = $p_showRow["show_id"];
$first_show = $p_showRow["first_show"]; //non-UTC $first_show = $p_showRow["first_show"]; //non-UTC
$start_time = $p_showRow["start_time"]; //non-UTC $start_time = $p_showRow["start_time"]; //non-UTC
$duration = $p_showRow["duration"]; $duration = $p_showRow["duration"];
$day = $p_showRow["day"];
$record = $p_showRow["record"]; $record = $p_showRow["record"];
$timezone = $p_showRow["timezone"]; $timezone = $p_showRow["timezone"];
$start = $first_show." ".$start_time; $start = $first_show." ".$start_time;
@ -1396,8 +1404,6 @@ SQL;
*/ */
private static function populateRepeatingShow($p_showDaysRow, $p_populateUntilDateTime, $p_interval) private static function populateRepeatingShow($p_showDaysRow, $p_populateUntilDateTime, $p_interval)
{ {
$con = Propel::getConnection();
$show_id = $p_showDaysRow["show_id"]; $show_id = $p_showDaysRow["show_id"];
$next_pop_date = $p_showDaysRow["next_pop_date"]; $next_pop_date = $p_showDaysRow["next_pop_date"];
$first_show = $p_showDaysRow["first_show"]; //non-UTC $first_show = $p_showDaysRow["first_show"]; //non-UTC
@ -1606,8 +1612,6 @@ SQL;
*/ */
public static function getShows($start_timestamp, $end_timestamp, $onlyRecord=FALSE) public static function getShows($start_timestamp, $end_timestamp, $onlyRecord=FALSE)
{ {
$con = Propel::getConnection();
//UTC DateTime object //UTC DateTime object
$showsPopUntil = Application_Model_Preference::GetShowsPopulatedUntil(); $showsPopUntil = Application_Model_Preference::GetShowsPopulatedUntil();
//if application is requesting shows past our previous populated until date, generate shows up until this point. //if application is requesting shows past our previous populated until date, generate shows up until this point.
@ -2061,9 +2065,6 @@ SQL;
*/ */
public static function getNextShows($timeStart, $limit = "ALL", $timeEnd = "") public static function getNextShows($timeStart, $limit = "ALL", $timeEnd = "")
{ {
global $CC_CONFIG;
$con = Propel::getConnection();
// defaults to retrieving shows from next 2 days if no end time has // defaults to retrieving shows from next 2 days if no end time has
// been specified // been specified
if ($timeEnd == "") { if ($timeEnd == "") {
@ -2093,19 +2094,10 @@ WHERE si.show_id = s.id
ORDER BY si.starts ORDER BY si.starts
LIMIT :lim LIMIT :lim
SQL; SQL;
return Application_Common_Database::prepareAndExecute( $sql, array(
$stmt = $con->prepare($sql); ':timeStart' => $timeStart,
$stmt->bindParam(':timeStart', $timeStart); ':timeEnd' => $timeEnd,
$stmt->bindParam(':timeEnd', $timeEnd); ':lim' => $limit), 'all');
$stmt->bindParam(':lim', $limit);
if ($stmt->execute()) {
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
} else {
$msg = implode(',', $stmt->errorInfo());
throw new Exception("Error: $msg");
}
} }
/** /**
@ -2117,8 +2109,6 @@ SQL;
*/ */
public static function convertToLocalTimeZone(&$rows, $columnsToConvert) public static function convertToLocalTimeZone(&$rows, $columnsToConvert)
{ {
$timezone = date_default_timezone_get();
if (!is_array($rows)) { if (!is_array($rows)) {
return; return;
} }

View File

@ -43,7 +43,7 @@ class Application_Model_StoredFile
"bit_rate" => "DbBitRate", "bit_rate" => "DbBitRate",
"sample_rate" => "DbSampleRate", "sample_rate" => "DbSampleRate",
"mime" => "DbMime", "mime" => "DbMime",
"md5" => "DbMd5", //"md5" => "DbMd5",
"ftype" => "DbFtype", "ftype" => "DbFtype",
"language" => "DbLanguage", "language" => "DbLanguage",
"replay_gain" => "DbReplayGain", "replay_gain" => "DbReplayGain",
@ -84,6 +84,12 @@ class Application_Model_StoredFile
$this->_file->save(); $this->_file->save();
} }
public static function createWithFile($f) {
$storedFile = new Application_Model_StoredFile();
$storedFile->_file = $f;
return $storedFile;
}
/** /**
* Set multiple metadata values using defined metadata constants. * Set multiple metadata values using defined metadata constants.
* *
@ -226,6 +232,7 @@ class Application_Model_StoredFile
return; return;
} }
if (isset($this->_dbMD[$p_category])) { if (isset($this->_dbMD[$p_category])) {
// TODO : fix this crust -- RG
$propelColumn = $this->_dbMD[$p_category]; $propelColumn = $this->_dbMD[$p_category];
$method = "set$propelColumn"; $method = "set$propelColumn";
$this->_file->$method($p_value); $this->_file->$method($p_value);
@ -315,12 +322,13 @@ class Application_Model_StoredFile
*/ */
public function getPlaylists() public function getPlaylists()
{ {
global $CC_CONFIG;
$con = Propel::getConnection(); $con = Propel::getConnection();
$sql = "SELECT playlist_id " $sql = <<<SQL
." FROM cc_playlist" SELECT playlist_id
." WHERE file_id = :file_id"; FROM cc_playlist
WHERE file_id = :file_id
SQL;
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindParam(':file_id', $this->id, PDO::PARAM_INT); $stmt->bindParam(':file_id', $this->id, PDO::PARAM_INT);
@ -332,14 +340,13 @@ class Application_Model_StoredFile
throw new Exception("Error: $msg"); throw new Exception("Error: $msg");
} }
$playlists = array();
if (is_array($ids) && count($ids) > 0) { if (is_array($ids) && count($ids) > 0) {
foreach ($ids as $id) { return array_map( function ($id) {
$playlists[] = Application_Model_Playlist::Recall($id); return Application_Model_Playlist::Recall($id);
} }, $ids);
} else {
return array();
} }
return $playlists;
} }
/** /**
@ -533,81 +540,29 @@ class Application_Model_StoredFile
return $storedFile; return $storedFile;
} }
/** public static function Recall($p_id=null, $p_gunid=null, $p_md5sum=null,
* Fetch instance of StoreFile object.<br> $p_filepath=null) {
* Should be supplied with only ONE parameter, all the rest should if( isset($p_id ) ) {
* be NULL. $f = CcFilesQuery::create()->findPK(intval($p_id));
* return is_null($f) ? null : self::createWithFile($f);
* @param int $p_id } elseif ( isset($p_gunid) ) {
* local id throw new Exception("You should never use gunid ($gunid) anymore");
* @param string $p_gunid - TODO: Remove this! } elseif ( isset($p_md5sum) ) {
* global unique id of file throw new Exception("Searching by md5($p_md5sum) is disabled");
* @param string $p_md5sum } elseif ( isset($p_filepath) ) {
* MD5 sum of the file return is_null($f) ? null : self::createWithFile(
* @param boolean $exist Application_Model_StoredFile::RecallByFilepath($p_filepath));
* When this is true, it check against only files with file_exist is 'true'
* @return Application_Model_StoredFile|NULL
* Return NULL if the object doesnt exist in the DB.
*/
public static function Recall($p_id=null, $p_gunid=null, $p_md5sum=null, $p_filepath=null, $exist=false)
{
if (isset($p_id)) {
$file = CcFilesQuery::create()->findPK(intval($p_id));
} elseif (isset($p_md5sum)) {
if ($exist) {
$file = CcFilesQuery::create()
->filterByDbMd5($p_md5sum)
->filterByDbFileExists(true)
->findOne();
} else {
$file = CcFilesQuery::create()
->filterByDbMd5($p_md5sum)
->findOne();
}
} elseif (isset($p_filepath)) {
$path_info = Application_Model_MusicDir::splitFilePath($p_filepath);
if (is_null($path_info)) {
return null;
}
$music_dir = Application_Model_MusicDir::getDirByPath($path_info[0]);
$file = CcFilesQuery::create()
->filterByDbDirectory($music_dir->getId())
->filterByDbFilepath($path_info[1])
->findOne();
} else { } else {
return null; throw new Exception("No arguments passsed to Recall");
}
if (isset($file)) {
$storedFile = new Application_Model_StoredFile();
$storedFile->_file = $file;
return $storedFile;
} else {
return null;
} }
} }
public function getName() public function getName()
{ {
$info = pathinfo($this->getFilePath()); $info = pathinfo($this->getFilePath());
return $info['filename']; return $info['filename'];
} }
/**
* Fetch the Application_Model_StoredFile by looking up the MD5 value.
*
* @param string $p_md5sum
* @return Application_Model_StoredFile|NULL
*/
public static function RecallByMd5($p_md5sum, $exist=false)
{
return Application_Model_StoredFile::Recall(null, null, $p_md5sum, null, $exist);
}
/** /**
* Fetch the Application_Model_StoredFile by looking up its filepath. * Fetch the Application_Model_StoredFile by looking up its filepath.
* *
@ -616,7 +571,18 @@ class Application_Model_StoredFile
*/ */
public static function RecallByFilepath($p_filepath) public static function RecallByFilepath($p_filepath)
{ {
return Application_Model_StoredFile::Recall(null, null, null, $p_filepath); $path_info = Application_Model_MusicDir::splitFilePath($p_filepath);
if (is_null($path_info)) {
return null;
}
$music_dir = Application_Model_MusicDir::getDirByPath($path_info[0]);
$file = CcFilesQuery::create()
->filterByDbDirectory($music_dir->getId())
->filterByDbFilepath($path_info[1])
->findOne();
return is_null($file) ? null : self::createWithFile($file);
} }
public static function RecallByPartialFilepath($partial_path) public static function RecallByPartialFilepath($partial_path)
@ -649,7 +615,7 @@ class Application_Model_StoredFile
$displayColumns = array("id", "track_title", "artist_name", "album_title", "genre", "length", $displayColumns = array("id", "track_title", "artist_name", "album_title", "genre", "length",
"year", "utime", "mtime", "ftype", "track_number", "mood", "bpm", "composer", "info_url", "year", "utime", "mtime", "ftype", "track_number", "mood", "bpm", "composer", "info_url",
"bit_rate", "sample_rate", "isrc_number", "encoded_by", "label", "copyright", "mime", "bit_rate", "sample_rate", "isrc_number", "encoded_by", "label", "copyright", "mime",
"language", "filepath", "owner", "conductor", "replay_gain", "lptime" "language", "filepath", "owner_id", "conductor", "replay_gain", "lptime"
); );
//Logging::info($datatables); //Logging::info($datatables);
@ -680,7 +646,7 @@ class Application_Model_StoredFile
$blSelect[] = "login AS ".$key; $blSelect[] = "login AS ".$key;
$fileSelect[] = $key; $fileSelect[] = $key;
$streamSelect[] = "login AS ".$key; $streamSelect[] = "login AS ".$key;
} elseif ($key === "owner") { } elseif ($key === "owner_id") {
$plSelect[] = "login AS ".$key; $plSelect[] = "login AS ".$key;
$blSelect[] = "login AS ".$key; $blSelect[] = "login AS ".$key;
$fileSelect[] = "sub.login AS $key"; $fileSelect[] = "sub.login AS $key";
@ -1024,11 +990,8 @@ class Application_Model_StoredFile
public static function getFileCount() public static function getFileCount()
{ {
global $CC_CONFIG;
$con = Propel::getConnection(); $con = Propel::getConnection();
$sql = "SELECT count(*) as cnt FROM cc_files WHERE file_exists"; $sql = "SELECT count(*) as cnt FROM cc_files WHERE file_exists";
return $con->query($sql)->fetchColumn(0); return $con->query($sql)->fetchColumn(0);
} }
@ -1101,10 +1064,14 @@ class Application_Model_StoredFile
try { try {
$con = Propel::getConnection(); $con = Propel::getConnection();
$sql = "SELECT soundcloud_id as id, soundcloud_upload_time" $sql = <<<SQL
." FROM CC_FILES" SELECT soundcloud_id AS id,
." WHERE (id != -2 and id != -3) and" soundcloud_upload_time
." (soundcloud_upload_time >= (now() - (INTERVAL '1 day')))"; FROM CC_FILES
WHERE (id != -2
AND id != -3)
AND (soundcloud_upload_time >= (now() - (INTERVAL '1 day')))
SQL;
$rows = $con->query($sql)->fetchAll(); $rows = $con->query($sql)->fetchAll();

View File

@ -46,7 +46,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
$di = new DateInterval("PT{$hours}H{$min}M{$sec}S"); $di = new DateInterval("PT{$hours}H{$min}M{$sec}S");
return $di->format("%Hh %Im"); return $di->format("%Hh %Im");
} }
return ""; return "";
} }
@ -207,18 +207,18 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
return false; return false;
} }
} }
return true; return true;
} }
// TODO : properly implement this interface
public function setMetadata($key, $val) public function setMetadata($key, $val)
{ {
throw new Exception("setMetadata is not imeplemented by WebStream yet");
} }
public function setName($name) public function setName($name)
{ {
throw new Exception("setName is not imeplemented by WebStream yet");
} }
public function setLastPlayed($timestamp) public function setLastPlayed($timestamp)

View File

@ -13,7 +13,7 @@ if ($item['type'] == 2) {
<div class="list-item-container"> <div class="list-item-container">
<?php if ($item['type'] == 0 && $item['exists']):?> <?php if ($item['type'] == 0 && $item['exists']):?>
<div class="big_play" audioFile="<?php echo $item["id"]; ?>"> <div class="big_play" audioFile="<?php echo $item["id"]; ?>" data-mime-type="<?php echo $item["mime"]; ?>">
<span class="ui-icon ui-icon-play"></span> <span class="ui-icon ui-icon-play"></span>
</div> </div>
<?php elseif ($item['type'] == 1 && $item['exists']): ?> <?php elseif ($item['type'] == 1 && $item['exists']): ?>

2707
airtime_mvc/public/css/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1013 B

View File

@ -1,132 +1,225 @@
.lib-content .fg-toolbar ul { .lib-content .fg-toolbar ul {
float: left; float: left;
padding: 0; padding: 0;
margin: 0.5em 0 0 10px; margin: 0.5em 0 0 10px;
cursor: pointer; cursor: pointer;
} }
.lib-content .fg-toolbar ul li { .lib-content .fg-toolbar ul li {
list-style-type: none; list-style-type: none;
float: left; float: left;
padding: 1px 2px; padding: 1px 2px;
margin-right: 5px; margin-right: 5px;
} }
.lib-selected.even { .lib-content .fg-toolbar ul.dropdown-menu {
background-color: rgba(240, 109, 53, 1); float: none;
} padding: 5px 0;
.lib-selected.odd { margin: 2px 0 0;
background-color: rgba(255, 136, 56, 1); cursor: default;
} }
.lib-content .fg-toolbar ul.dropdown-menu li {
#library_content { list-style-type: none;
float: left; float: none;
width: 50%; padding: 0;
overflow: hidden; margin-right: 0;
} }
.lib-content .fg-toolbar ul.dropdown-menu li.nav-header {
#library_display { padding-right: 20px;
/* for breaking up long strings that don't have delimiters */ padding-left: 20px;
table-layout:fixed; }
} .lib-selected.even {
background-color: rgba(240, 109, 53, 1);
#library_display th { }
text-align: left; .lib-selected.odd {
} background-color: rgba(255, 136, 56, 1);
}
#library_content #library_display {
width:100%; #library_content {
} float: left;
width: 50%;
#library_display td { overflow: hidden;
/* for breaking up long strings that don't have delimiters */ }
word-wrap: break-word;
} #library_display {
/* for breaking up long strings that don't have delimiters */
#library_display th, table-layout:fixed;
#library_display td, }
.paginationControl {
font-size: 13px; #library_display th {
} text-align: left;
}
#library_content .ui-tabs-panel {
padding-top:16px; #library_content #library_display {
} width:100%;
}
.paginationControl {
font-size: 12px; #library_display td {
background-color: #9a9a9a; /* for breaking up long strings that don't have delimiters */
background: -moz-linear-gradient(top, #ababab 0, #9a9a9a 100%); word-wrap: break-word;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ababab), color-stop(100%, #9a9a9a)); }
border:1px solid #5b5b5b;
border-width:0 1px 1px 1px; #library_display th,
padding:12px 8px 8px 8px; #library_display td,
} .paginationControl {
font-size: 13px;
.paginationControl p { }
color:#555555;
font-size:12px; #library_content .ui-tabs-panel {
margin:2px 0 10px 0; padding-top:16px;
} }
.paginationControl .ui-button-text-only .ui-button-text { .paginationControl {
padding: 0.2em 1em; font-size: 12px;
} background-color: #9a9a9a;
background: -moz-linear-gradient(top, #ababab 0, #9a9a9a 100%);
#library_display td { background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ababab), color-stop(100%, #9a9a9a));
-webkit-user-select: none; border:1px solid #5b5b5b;
-khtml-user-select: none; border-width:0 1px 1px 1px;
-moz-user-select: none; padding:12px 8px 8px 8px;
-o-user-select: none; }
user-select: none;
} .paginationControl p {
color:#555555;
.datatable_checkbox { font-size:12px;
text-align: center; margin:2px 0 10px 0;
} }
.datatable_checkbox .DataTables_sort_wrapper { .paginationControl .ui-button-text-only .ui-button-text {
text-align: center; padding: 0.2em 1em;
} }
.library_year { #library_display td {
text-align: center; -webkit-user-select: none;
} -khtml-user-select: none;
-moz-user-select: none;
td.library_track, -o-user-select: none;
td.library_sr, user-select: none;
td.library_bitrate { }
text-align: right;
} .datatable_checkbox {
text-align: center;
.library_import { }
padding-bottom: 5px;
} .datatable_checkbox .DataTables_sort_wrapper {
text-align: center;
.library_import img { }
vertical-align: middle;
padding-left: 5px; .library_year {
} text-align: center;
}
.file_type { td.library_track,
width:16px; td.library_sr,
height:13px; td.library_bitrate {
display:block; text-align: right;
background-image: url(images/filetype_icons.png); }
background-repeat:no-repeat;
} .library_import {
.file_type.audioclip { padding-bottom: 5px;
background-position: 0 0; }
}
a.file_type.audioclip:hover { .library_import img {
background-position: 0 -15px; vertical-align: middle;
} padding-left: 5px;
.file_type.playlist { }
background-position: -20px 0;
}
a.file_type.playlist:hover { .file_type {
background-position: -20px -15px; width:16px;
} height:13px;
display:block;
background-image: url(images/filetype_icons.png);
background-repeat:no-repeat;
}
.file_type.audioclip {
background-position: 0 0;
}
a.file_type.audioclip:hover {
background-position: 0 -15px;
}
.file_type.playlist {
background-position: -20px 0;
}
a.file_type.playlist:hover {
background-position: -20px -15px;
}
.fg-toolbar .btn-toolbar {margin: 6px 5px 6px 2px;}
/* ///////////////////// ADVANCED SEARCH ///////////////////// */
.advanced_search {
margin-bottom: 0;
}
.advanced_search > div {
margin-bottom: 6px;
}
.lib-content fieldset {
border: 1px solid #9a9a9a;
margin: 0 0 8px 0;
padding: 8px;
}
.lib-content > div + fieldset {
margin-top:3px;
}
.lib-content fieldset.closed {
border-width: 1px 0 0;
margin-bottom: -6px;
margin-left: 1px;
}
.dataTables_filter input[type="text"], .dataTables_filter select {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
height: 25px;
width:60%;
}
.dataTables_filter label {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: inline;
}
.search-criteria .criteria-element > div {
margin-bottom: 5px;
}
.search-criteria .criteria-element > div input[type="text"],
.search-criteria .criteria-element > div select {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
height: 25px;
}
.search-criteria .criteria-element > div .btn-small {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
height: 25px;
padding: 3px 6px;
}
.sb-timerange .btn-small {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
height: 25px;
vertical-align: middle;
margin: 0 !important;
line-height: 16px;
}
.sb-timerange input {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: inline-block;
float: none !important;
margin: 0 !important;
height: 25px;
outline: none;
vertical-align: middle !important;
}

View File

@ -22,12 +22,12 @@
clear: left; clear: left;
} }
#side_playlist button { /*#side_playlist button {
float: left; float: left;
font-size: 12px; font-size: 12px;
height: 28px; height: 28px;
margin: 0 7px 20px 0; margin: 0 7px 20px 0;
} }*/
#side_playlist input, #side_playlist input,
#side_playlist textarea { #side_playlist textarea {
@ -48,11 +48,11 @@
margin-bottom:0; margin-bottom:0;
} }
#side_playlist li { /*#side_playlist li {
width: 99.5%; width: 99.5%;
margin-bottom:-1px; margin-bottom:-1px;
position:relative; position:relative;
} }*/
#side_playlist li div.list-item-container, #side_playlist li div.list-item-container.ui-state-active { #side_playlist li div.list-item-container, #side_playlist li div.list-item-container.ui-state-active {
height:56px; height:56px;
@ -114,7 +114,6 @@
} }
.ui-icon-closethick, .ui-icon-closethick,
.ui-icon-play,
.spl_fade_control, .spl_fade_control,
.spl_text_input { .spl_text_input {
cursor: pointer; cursor: pointer;
@ -164,15 +163,31 @@
background: -moz-linear-gradient(top, #707070 0, #666666 100%); background: -moz-linear-gradient(top, #707070 0, #666666 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #707070), color-stop(100%, #666666)); background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #707070), color-stop(100%, #666666));
} }
#spl_sortable div.big_play_disabled {
display:block;
width:20px;
height:50px;
margin:2px 0 0 2px;
text-align:center;
border:1px solid #5b5b5b;
float:left;
background-color: #707070;
background: -moz-linear-gradient(top, #707070 0, #666666 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #707070), color-stop(100%, #666666));
}
#spl_sortable div.big_play:hover { #spl_sortable div.big_play:hover {
border:1px solid #282828; border:1px solid #282828;
background-color: #3b3b3b; background-color: #3b3b3b;
background: -moz-linear-gradient(top, #3b3b3b 0, #292929 100%); background: -moz-linear-gradient(top, #3b3b3b 0, #292929 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #3b3b3b), color-stop(100%, #292929)); background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #3b3b3b), color-stop(100%, #292929));
cursor: pointer;
} }
#spl_sortable div.big_play .ui-icon { #spl_sortable div.big_play .ui-icon {
margin: 17px 0 0 1px; margin: 17px 0 0 1px;
} }
#spl_sortable div.big_play_disabled .ui-icon {
margin: 17px 0 0 1px;
}
#spl_sortable div.big_play:hover .ui-icon-play, #spl_sortable div.big_play:hover .ui-icon-pause { #spl_sortable div.big_play:hover .ui-icon-play, #spl_sortable div.big_play:hover .ui-icon-pause {
background-image:url(redmond/images/ui-icons_ff5d1a_256x240.png); background-image:url(redmond/images/ui-icons_ff5d1a_256x240.png);
@ -464,3 +479,4 @@ div.helper li {
li.spl_empty { li.spl_empty {
height: 56px; height: 56px;
} }

View File

@ -1,283 +1,280 @@
@CHARSET "UTF-8"; @CHARSET "UTF-8";
.sb-content { .sb-content {
overflow: hidden; overflow: hidden;
} }
.sb-content .dataTables_scrolling { .sb-content .dataTables_scrolling {
overflow: auto; overflow: auto;
} }
.sb-content .dataTables_wrapper { .sb-content .dataTables_wrapper {
margin-left: -16px; margin-left: -16px;
} }
.sb-selected.even { .sb-selected.even {
background-color: rgba(240, 109, 53, 1); background-color: rgba(240, 109, 53, 1);
} }
.sb-selected.odd { .sb-selected.odd {
background-color: rgba(255, 136, 56, 1); background-color: rgba(255, 136, 56, 1);
} }
.sb-content .fg-toolbar ul { .sb-content .fg-toolbar ul {
float: left; float: left;
padding: 0; padding: 0;
margin: 0.5em 0 0 10px; margin: 0.5em 0 0 10px;
cursor: pointer; cursor: pointer;
} }
.sb-content .fg-toolbar ul li { .sb-content .fg-toolbar ul li {
list-style-type: none; list-style-type: none;
float: left; float: left;
padding: 1px 2px; padding: 1px 2px;
margin-right: 5px; margin-right: 5px;
} }
.sb-padded { .sb-padded {
/* /*
the padding is needed here so that the cursor arrows with a negative margin are displayable. the padding is needed here so that the cursor arrows with a negative margin are displayable.
*/ */
padding-left: 16px; padding-left: 16px;
} }
.sb-content fieldset legend { .sb-content fieldset legend {
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
width: 110px; width: 110px;
} }
.sb-content fieldset label { .sb-content fieldset label {
padding: 2px; padding: 2px;
font-size: 12px; font-size: 12px;
} }
.sb-content fieldset select { .sb-content fieldset select {
margin-right: 10px; margin-right: 10px;
} }
.sb-content input[type="checkbox"] { .sb-content input[type="checkbox"] {
position: relative; position: relative;
top: 3px; top: 3px;
} }
.sb-content fieldset { .sb-content fieldset {
margin-bottom: 8px; margin-bottom: 8px;
} }
.sb-content fieldset.closed { .sb-content fieldset.closed {
border-width: 1px 0 0; border-width: 1px 0 0;
margin-bottom: -16px; margin-bottom: -16px;
margin-left:1px; margin-left:1px;
} }
.sb-content fieldset.closed .sb-options-form { .sb-content fieldset.closed .sb-options-form {
display: none; display: none;
} }
.sb-content th { .sb-content th {
text-align: left; text-align: left;
} }
.sb-content input.input_text.hasDatepicker { .sb-content input.input_text.hasDatepicker {
width:95px; width:95px;
} }
.sb-content input.input_text.hasTimepicker { .sb-content input.input_text.hasTimepicker {
width:60px; width:60px;
} }
div.sb-timerange { div.sb-timerange {
position: relative; position: relative;
} }
div.sb-timerange div#sb_edit { div.sb-timerange div#sb_edit {
position:absolute; position:absolute;
padding: 3px; padding: 3px;
} }
div.sb-timerange div#sb_submit { div.sb-timerange div#sb_submit {
padding: 3px; padding: 3px;
margin-left: 5px; margin-left: 5px;
} }
div.sb-timerange input {
vertical-align: top; div.sb-timerange input#sb_date_start {
} margin-left: 30px;
}
div.sb-timerange input#sb_date_start {
margin-left: 30px; .sb-starts,
} .sb-ends {
text-align: center;
.sb-starts, }
.sb-ends {
text-align: center; .innerWrapper {
} position:relative;
width:100%;
.innerWrapper { }
position:relative; .marker {
width:100%; background: url(images/tl-arrow.png) no-repeat scroll 3px 4px;
} top: -14px;
.marker { display: block;
background: url(images/tl-arrow.png) no-repeat scroll 3px 4px; height: 9px;
top: -14px; left: -17px;
display: block; padding: 4px 0 4px 3px;
height: 9px; position: absolute;
left: -17px; width: 9px;
padding: 4px 0 4px 3px; background-color: rgba(70, 70, 70, 0.35);
position: absolute; border-radius: 2px 0 0 2px;
width: 9px; cursor:pointer;
background-color: rgba(70, 70, 70, 0.35); }
border-radius: 2px 0 0 2px; .marker:hover {
cursor:pointer; background-color: rgba(70, 70, 70, 0.95);
} border-radius: 2px 0 0 2px;
.marker:hover { }
background-color: rgba(70, 70, 70, 0.95); tr.cursor-selected-row .marker {
border-radius: 2px 0 0 2px; background-color: rgba(215, 0, 0, 1);
} }
tr.cursor-selected-row .marker {
background-color: rgba(215, 0, 0, 1); table.datatable tr.cursor-selected-row td, table.datatable tr.cursor-selected-row th {
} border-top: 1px solid rgba(215, 0, 0, 1) !important;
}
table.datatable tr.cursor-selected-row td, table.datatable tr.cursor-selected-row th {
border-top: 1px solid rgba(215, 0, 0, 1) !important; .sb-content .sb-past {
} opacity: .6;
}
.sb-content .sb-past {
opacity: .6; .sb-placeholder {
} height: 35px;
padding: 5px;
.sb-placeholder { }
height: 35px;
padding: 5px; .sb-boundry td.sb-image,
} .sb-boundry td.sb-starts,
.sb-boundry td.sb-ends,
.sb-boundry td.sb-image, .sb-boundry td.sb-length,
.sb-boundry td.sb-starts, .sb-boundry td.sb-title,
.sb-boundry td.sb-ends, .sb-boundry td.sb-creator,
.sb-boundry td.sb-length, .sb-boundry td.sb-album,
.sb-boundry td.sb-title, .sb-boundry td.sb-cue-in,
.sb-boundry td.sb-creator, .sb-boundry td.sb-cue-out,
.sb-boundry td.sb-album, .sb-boundry td.sb-fade-in,
.sb-boundry td.sb-cue-in, .sb-boundry td.sb-fade-out {
.sb-boundry td.sb-cue-out, background-color: rgba(230, 106, 49, 0.5);
.sb-boundry td.sb-fade-in, }
.sb-boundry td.sb-fade-out {
background-color: rgba(230, 106, 49, 0.5); .sb-over td.sb-image,
} .sb-over td.sb-starts,
.sb-over td.sb-ends,
.sb-over td.sb-image, .sb-over td.sb-length,
.sb-over td.sb-starts, .sb-over td.sb-title,
.sb-over td.sb-ends, .sb-over td.sb-creator,
.sb-over td.sb-length, .sb-over td.sb-album,
.sb-over td.sb-title, .sb-over td.sb-cue-in,
.sb-over td.sb-creator, .sb-over td.sb-cue-out,
.sb-over td.sb-album, .sb-over td.sb-fade-in,
.sb-over td.sb-cue-in, .sb-over td.sb-fade-out {
.sb-over td.sb-cue-out, background-color: rgba(255, 0, 0, 0.5);
.sb-over td.sb-fade-in, }
.sb-over td.sb-fade-out {
background-color: rgba(255, 0, 0, 0.5); .sb-now-playing td {
} background-color: rgba(23, 235, 37, 1) !important;
}
.sb-now-playing td {
background-color: rgba(23, 235, 37, 1) !important; .sb-content.padded {
} padding: 8px 8px 8px 16px;
}
.sb-content.padded {
padding: 8px 8px 8px 16px; table.dataTable tr.sb-past,
} table.dataTable tr.sb-header,
table.dataTable tr.sb-footer,
table.dataTable tr.sb-past, table.dataTable tr.sb-not-allowed {
table.dataTable tr.sb-header, cursor: auto;
table.dataTable tr.sb-footer, }
table.dataTable tr.sb-not-allowed {
cursor: auto; table.dataTable td.sb-image {
} cursor: pointer;
}
table.dataTable td.sb-image {
cursor: pointer; table.datatable tr.sb-header.odd td, table.datatable tr.sb-header.even td,
} table.datatable tr.sb-header.odd:hover td, table.datatable tr.sb-header.even:hover td{
background: -moz-linear-gradient(top, #a4a4a4 0, #bcbcbc 100%);
table.datatable tr.sb-header.odd td, table.datatable tr.sb-header.even td, background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #a4a4a4), color-stop(100%, #bcbcbc));
table.datatable tr.sb-header.odd:hover td, table.datatable tr.sb-header.even:hover td{ background: linear-gradient(top, #a4a4a4 0, #bcbcbc 100%);
background: -moz-linear-gradient(top, #a4a4a4 0, #bcbcbc 100%); border-top-color:#6b6a6a !important;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #a4a4a4), color-stop(100%, #bcbcbc)); }
background: linear-gradient(top, #a4a4a4 0, #bcbcbc 100%);
border-top-color:#6b6a6a !important; .sb-content tr:last-child td {
} border-bottom-width: 1px !important;
border-bottom-color:#6b6a6a !important;
.sb-content tr:last-child td { }
border-bottom-width: 1px !important;
border-bottom-color:#6b6a6a !important; .sb-header div.ui-state-default {
} float: left;
}
.sb-header div.ui-state-default {
float: left; .sb-content input.ui-button {
} padding: 3px 1em;
}
.sb-content input.ui-button { .color-box {
padding: 3px 1em; position:absolute;
} top:-5px;
.color-box { bottom:-5px;
position:absolute; left:-5px;
top:-5px; width:27px;
bottom:-5px; background: rgba(140, 2, 140, 1);
left:-5px; }
width:27px;
background: rgba(140, 2, 140, 1); .show-title, .show-time {
} display:inline-block;
font-size:13px;
.show-title, .show-time { }
display:inline-block; .show-title {
font-size:13px; font-weight: bold;
} margin: 0 8px;
.show-title { }
font-weight: bold;
margin: 0 8px; .show-date {
} font-size:12px;
color: #363636;
.show-date { margin-left: 5px;
font-size:12px; }
color: #363636;
margin-left: 5px; .show-time {
} font-size:12px;
color: #363636;
.show-time { margin: 0 5px;
font-size:12px; }
color: #363636;
margin: 0 5px; .push-right {
} float:right;
margin-right:5px;
.push-right { }
float:right;
margin-right:5px; /*
} * keep the dialog css at the bottom so it can override previous rules if needed.
*/
/*
* keep the dialog css at the bottom so it can override previous rules if needed. .ui-dialog .wrapper {
*/ margin: 0;
padding: 10px 0 0 0;
.ui-dialog .wrapper { overflow: hidden;
margin: 0; }
padding: 10px 0 0 0;
overflow: hidden; .ui-dialog .lib_content {
} margin: 0 10px 10px 0;
overflow: auto;
.ui-dialog .lib_content { min-height: 0;
margin: 0 10px 10px 0; }
overflow: auto;
min-height: 0; .ui-dialog .sb-content {
} margin: 0 0 10px 0;
overflow: auto;
.ui-dialog .sb-content { }
margin: 0 0 10px 0;
overflow: auto; .ui-dialog .lib_content .padded {
} padding: 5px 10px 5px 8px;
}
.ui-dialog .lib_content .padded {
padding: 5px 10px 5px 8px; .ui-dialog .sb_content .padded {
} padding: 5px 10px 5px 16px;
.ui-dialog .sb_content .padded {
padding: 5px 10px 5px 16px;
} }

File diff suppressed because it is too large Load Diff

View File

@ -22,6 +22,9 @@ defined('APPLICATION_PATH')
defined('APPLICATION_ENV') defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production')); || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
defined('VERBOSE_STACK_TRACE')
|| define('VERBOSE_STACK_TRACE', (getenv('VERBOSE_STACK_TRACE') ? getenv('VERBOSE_STACK_TRACE') : true));
// Ensure library/ is on include_path // Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array( set_include_path(implode(PATH_SEPARATOR, array(
get_include_path(), get_include_path(),
@ -67,6 +70,10 @@ try {
echo $e->getTraceAsString(); echo $e->getTraceAsString();
echo "</pre>"; echo "</pre>";
Logging::info($e->getMessage()); Logging::info($e->getMessage());
Logging::info($e->getTraceAsString()); if (VERBOSE_STACK_TRACE) {
Logging::info($e->getTraceAsString());
} else {
Logging::info($e->getTrace());
}
} }

View File

@ -0,0 +1,10 @@
var audio = new Audio();
supportedAudio = {};
supportedAudio["audio/ogg"] = !!audio.canPlayType && audio.canPlayType('audio/ogg; codecs="vorbis"') != "";
supportedAudio["audio/mp3"] = !!audio.canPlayType && audio.canPlayType('audio/mp3') != "";
supportedAudio["audio/mp4"] = !!audio.canPlayType && audio.canPlayType('audio/mp4') != "";
supportedAudio["audio/x-flac"] = !!audio.canPlayType && audio.canPlayType('audio/x-flac') != "";
function isAudioSupported(mime){
return mime in supportedAudio && supportedAudio[mime];
}

View File

@ -36,7 +36,7 @@ var AIRTIME = (function(AIRTIME) {
"track_title" : "s", "track_title" : "s",
"track_num" : "n", "track_num" : "n",
"year" : "n", "year" : "n",
"owner" : "s", "owner_id" : "s",
"replay_gain" : "n" "replay_gain" : "n"
}; };
@ -351,7 +351,6 @@ var AIRTIME = (function(AIRTIME) {
if (ele.bSearchable) { if (ele.bSearchable) {
var currentColId = ele._ColReorder_iOrigCol; var currentColId = ele._ColReorder_iOrigCol;
var label = ""; var label = "";
console.log(ele);
if (ele.mDataProp == "bit_rate") { if (ele.mDataProp == "bit_rate") {
label = " (bps)"; label = " (bps)";
} else if (ele.mDataProp == "utime" || ele.mDataProp == "mtime" || ele.mDataProp == "lptime") { } else if (ele.mDataProp == "utime" || ele.mDataProp == "mtime" || ele.mDataProp == "lptime") {
@ -404,32 +403,32 @@ var AIRTIME = (function(AIRTIME) {
"aoColumns": [ "aoColumns": [
/* ftype */ { "sTitle" : "" , "mDataProp" : "ftype" , "bSearchable" : false , "bVisible" : false } , /* ftype */ { "sTitle" : "" , "mDataProp" : "ftype" , "bSearchable" : false , "bVisible" : false } ,
/* Checkbox */ { "sTitle" : "" , "mDataProp" : "checkbox" , "bSortable" : false , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_checkbox" } , /* Checkbox */ { "sTitle" : "" , "mDataProp" : "checkbox" , "bSortable" : false , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_checkbox" } ,
/* Type */ { "sTitle" : "" , "mDataProp" : "image" , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_type" , "iDataSort" : 0 } , /* Type */ { "sTitle" : "" , "mDataProp" : "image" , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_type" , "iDataSort" : 0 } ,
/* Title */ { "sTitle" : "Title" , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } , /* Title */ { "sTitle" : "Title" , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } ,
/* Creator */ { "sTitle" : "Creator" , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } , /* Creator */ { "sTitle" : "Creator" , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } ,
/* Album */ { "sTitle" : "Album" , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } , /* Album */ { "sTitle" : "Album" , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } ,
/* Genre */ { "sTitle" : "Genre" , "mDataProp" : "genre" , "bVisible" : false , "sClass" : "library_genre" , "sWidth" : "100px" } ,
/* Year */ { "sTitle" : "Year" , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" } ,
/* Length */ { "sTitle" : "Length" , "mDataProp" : "length" , "sClass" : "library_length" , "sWidth" : "80px" } ,
/* Upload Time */ { "sTitle" : "Uploaded" , "mDataProp" : "utime" , "sClass" : "library_upload_time" , "sWidth" : "125px" } ,
/* Last Modified */ { "sTitle" : "Last Modified" , "mDataProp" : "mtime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" } ,
/* Last Played */ { "sTitle" : "Last Played " , "mDataProp" : "lptime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" } ,
/* Track Number */ { "sTitle" : "Track" , "mDataProp" : "track_number" , "bVisible" : false , "sClass" : "library_track" , "sWidth" : "65px" } ,
/* Mood */ { "sTitle" : "Mood" , "mDataProp" : "mood" , "bVisible" : false , "sClass" : "library_mood" , "sWidth" : "70px" } ,
/* BPM */ { "sTitle" : "BPM" , "mDataProp" : "bpm" , "bVisible" : false , "sClass" : "library_bpm" , "sWidth" : "50px" } ,
/* Composer */ { "sTitle" : "Composer" , "mDataProp" : "composer" , "bVisible" : false , "sClass" : "library_composer" , "sWidth" : "150px" } ,
/* Website */ { "sTitle" : "Website" , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" } ,
/* Bit Rate */ { "sTitle" : "Bit Rate" , "mDataProp" : "bit_rate" , "bVisible" : false , "sClass" : "library_bitrate" , "sWidth" : "80px" } , /* Bit Rate */ { "sTitle" : "Bit Rate" , "mDataProp" : "bit_rate" , "bVisible" : false , "sClass" : "library_bitrate" , "sWidth" : "80px" } ,
/* Sample Rate */ { "sTitle" : "Sample" , "mDataProp" : "sample_rate" , "bVisible" : false , "sClass" : "library_sr" , "sWidth" : "80px" } , /* BPM */ { "sTitle" : "BPM" , "mDataProp" : "bpm" , "bVisible" : false , "sClass" : "library_bpm" , "sWidth" : "50px" } ,
/* ISRC Number */ { "sTitle" : "ISRC" , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" } , /* Composer */ { "sTitle" : "Composer" , "mDataProp" : "composer" , "bVisible" : false , "sClass" : "library_composer" , "sWidth" : "150px" } ,
/* Conductor */ { "sTitle" : "Conductor" , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" },
/* Copyright */ { "sTitle" : "Copyright" , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" } ,
/* Encoded */ { "sTitle" : "Encoded By" , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" } , /* Encoded */ { "sTitle" : "Encoded By" , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" } ,
/* Genre */ { "sTitle" : "Genre" , "mDataProp" : "genre" , "bVisible" : false , "sClass" : "library_genre" , "sWidth" : "100px" } ,
/* ISRC Number */ { "sTitle" : "ISRC" , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" } ,
/* Label */ { "sTitle" : "Label" , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" } , /* Label */ { "sTitle" : "Label" , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" } ,
/* Copyright */ { "sTitle" : "Copyright" , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" } ,
/* Mime */ { "sTitle" : "Mime" , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" } ,
/* Language */ { "sTitle" : "Language" , "mDataProp" : "language" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" } , /* Language */ { "sTitle" : "Language" , "mDataProp" : "language" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" } ,
/* Owner */ { "sTitle" : "Owner" , "mDataProp" : "owner" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" } , /* Last Modified */ { "sTitle" : "Last Modified" , "mDataProp" : "mtime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" } ,
/* Conductor */ { "sTitle" : "Conductor" , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" }, /* Last Played */ { "sTitle" : "Last Played " , "mDataProp" : "lptime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" } ,
/* Replay Gain */ { "sTitle" : "Replay Gain" , "mDataProp" : "replay_gain" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "80px" } /* Length */ { "sTitle" : "Length" , "mDataProp" : "length" , "sClass" : "library_length" , "sWidth" : "80px" } ,
/* Mime */ { "sTitle" : "Mime" , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" } ,
/* Mood */ { "sTitle" : "Mood" , "mDataProp" : "mood" , "bVisible" : false , "sClass" : "library_mood" , "sWidth" : "70px" } ,
/* Owner */ { "sTitle" : "Owner" , "mDataProp" : "owner_id" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" } ,
/* Replay Gain */ { "sTitle" : "Replay Gain" , "mDataProp" : "replay_gain" , "bVisible" : false , "sClass" : "library_replay_gain" , "sWidth" : "80px" },
/* Sample Rate */ { "sTitle" : "Sample Rate" , "mDataProp" : "sample_rate" , "bVisible" : false , "sClass" : "library_sr" , "sWidth" : "80px" } ,
/* Track Number */ { "sTitle" : "Track Number" , "mDataProp" : "track_number" , "bVisible" : false , "sClass" : "library_track" , "sWidth" : "65px" } ,
/* Upload Time */ { "sTitle" : "Uploaded" , "mDataProp" : "utime" , "sClass" : "library_upload_time" , "sWidth" : "125px" } ,
/* Website */ { "sTitle" : "Website" , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" } ,
/* Year */ { "sTitle" : "Year" , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" }
], ],
"bProcessing": true, "bProcessing": true,
@ -718,6 +717,7 @@ var AIRTIME = (function(AIRTIME) {
callback = function() { callback = function() {
var url = '/Playlist/edit'; var url = '/Playlist/edit';
AIRTIME.playlist.fnEdit(data.id, data.ftype, url); AIRTIME.playlist.fnEdit(data.id, data.ftype, url);
AIRTIME.playlist.validatePlaylistElements();
}; };
} else if (data.ftype === "stream") { } else if (data.ftype === "stream") {
callback = function() { callback = function() {
@ -732,6 +732,13 @@ var AIRTIME = (function(AIRTIME) {
//define a play callback. //define a play callback.
if (oItems.play !== undefined) { if (oItems.play !== undefined) {
if (oItems.play.mime !== undefined) {
if (!isAudioSupported(oItems.play.mime)) {
oItems.play.disabled = true;
}
}
callback = function() { callback = function() {
if (data.ftype === 'playlist' && data.length !== '0.0'){ if (data.ftype === 'playlist' && data.length !== '0.0'){
playlistIndex = $(this).parent().attr('id').substring(3); //remove the pl_ playlistIndex = $(this).parent().attr('id').substring(3); //remove the pl_
@ -929,7 +936,7 @@ function addQtipToSCIcons(){
else if($(this).hasClass("soundcloud")){ else if($(this).hasClass("soundcloud")){
$(this).qtip({ $(this).qtip({
content: { content: {
text: "Retreiving data from the server...", text: "Retrieving data from the server...",
ajax: { ajax: {
url: "/Library/get-upload-to-soundcloud-status", url: "/Library/get-upload-to-soundcloud-status",
type: "post", type: "post",
@ -1115,13 +1122,12 @@ var validationTypes = {
"mood" : "s", "mood" : "s",
"name" : "s", "name" : "s",
"orchestra" : "s", "orchestra" : "s",
"owner" : "s", "owner_id" : "s",
"rating" : "i", "rating" : "i",
"replay_gain" : "n", "replay_gain" : "n",
"sample_rate" : "i", "sample_rate" : "i",
"track_title" : "s", "track_title" : "s",
"track_number" : "i", "track_number" : "i",
"info_url" : "s", "info_url" : "s",
"year" : "i", "year" : "i"
"lptime" : "t"
}; };

View File

@ -3,13 +3,13 @@ $(document).ready(function() {
$("#plupload_files").pluploadQueue({ $("#plupload_files").pluploadQueue({
// General settings // General settings
runtimes : 'gears, html5, html4', runtimes : 'gears, html5, html4',
url : '/Plupload/upload/format/json', url : '/Plupload/upload/format/json',
chunk_size: '5mb', chunk_size : '5mb',
unique_names: 'true', unique_names : 'true',
multiple_queues : 'true', multiple_queues : 'true',
filters : [ filters : [
{title: "Audio Files", extensions: "ogg,mp3,oga,flac,aac,wav"} {title: "Audio Files", extensions: "ogg,mp3,oga,flac,aac,wav,m4a"}
] ]
}); });

View File

@ -346,7 +346,6 @@ var AIRTIME = (function(AIRTIME){
} }
function openPlaylist(json) { function openPlaylist(json) {
$("#side_playlist") $("#side_playlist")
.empty() .empty()
.append(json.html); .append(json.html);
@ -361,6 +360,39 @@ var AIRTIME = (function(AIRTIME){
appendModAddButton(); appendModAddButton();
removeButtonCheck(); removeButtonCheck();
} }
//Purpose of this function is to iterate over all playlist elements
//and verify whether they can be previewed by the browser or not. If not
//then the playlist element is greyed out
mod.validatePlaylistElements = function(){
$.each($(".big_play"), function(index, value){
var mime = $(value).attr("data-mime-type");
if (isAudioSupported(mime)) {
$(value).bind("click", openAudioPreview);
} else {
$(value).attr("class", "big_play_disabled dark_class");
$(value).qtip({
content: 'Your browser does not support playing this file type: "'+ mime +'"',
show: 'mouseover',
hide: {
delay: 500,
fixed: true
},
style: {
border: {
width: 0,
radius: 4
},
classes: "ui-tooltip-dark ui-tooltip-rounded"
},
position: {
my: "left bottom",
at: "right center"
},
})
}
});
}
//sets events dynamically for playlist entries (each row in the playlist) //sets events dynamically for playlist entries (each row in the playlist)
function setPlaylistEntryEvents() { function setPlaylistEntryEvents() {
@ -378,10 +410,8 @@ var AIRTIME = (function(AIRTIME){
$pl.delegate(".spl_cue", $pl.delegate(".spl_cue",
{"click": openCueEditor}); {"click": openCueEditor});
//add the play function to the play icon mod.validatePlaylistElements();
$pl.delegate(".big_play",
{"click": openAudioPreview});
$pl.delegate(".spl_block_expand", $pl.delegate(".spl_block_expand",
{"click": function(ev){ {"click": function(ev){
var id = parseInt($(this).attr("id").split("_").pop(), 10); var id = parseInt($(this).attr("id").split("_").pop(), 10);

View File

@ -204,6 +204,20 @@ function setSmartBlockEvents() {
/********** CRITERIA CHANGE **********/ /********** CRITERIA CHANGE **********/
form.find('select[id^="sp_criteria"]:not([id^="sp_criteria_modifier"])').live("change", function(){ form.find('select[id^="sp_criteria"]:not([id^="sp_criteria_modifier"])').live("change", function(){
var index = getRowIndex($(this).parent()); var index = getRowIndex($(this).parent());
//need to change the criteria value for any modifier rows
var critVal = $(this).val();
var divs = $(this).parent().nextAll(':visible');
$.each(divs, function(i, div){
var critSelect = $(div).children('select[id^="sp_criteria_field"]');
if (critSelect.hasClass('sp-invisible')) {
critSelect.val(critVal);
/* If the select box is visible we know the modifier rows
* have ended
*/
} else {
return false;
}
});
// disable extra field and hide the span // disable extra field and hide the span
disableAndHideExtraField($(this), index); disableAndHideExtraField($(this), index);
@ -520,32 +534,32 @@ function disableLoadingIcon() {
} }
var criteriaTypes = { var criteriaTypes = {
0 : "", 0 : "",
"album_title" : "s", "album_title" : "s",
"artist_name" : "s", "bit_rate" : "n",
"bit_rate" : "n", "bpm" : "n",
"bpm" : "n", "composer" : "s",
"comments" : "s", "conductor" : "s",
"composer" : "s", "copyright" : "s",
"conductor" : "s", "artist_name" : "s",
"utime" : "n", "encoded_by" : "s",
"mtime" : "n", "utime" : "n",
"lptime" : "n", "mtime" : "n",
"disc_number" : "n", "lptime" : "n",
"genre" : "s", "genre" : "s",
"isrc_number" : "s", "isrc_number" : "s",
"label" : "s", "label" : "s",
"language" : "s", "language" : "s",
"length" : "n", "length" : "n",
"lyricist" : "s", "mime" : "s",
"mood" : "s", "mood" : "s",
"name" : "s", "owner_id" : "s",
"orchestra" : "s", "replay_gain" : "n",
"rating" : "n", "sample_rate" : "n",
"sample_rate" : "n", "track_title" : "s",
"track_title" : "s", "track_number" : "n",
"track_num" : "n", "info_url" : "s",
"year" : "n" "year" : "n"
}; };
var stringCriteriaOptions = { var stringCriteriaOptions = {

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -47,13 +47,13 @@ fi
apt-get update apt-get update
# Updated package list # Updated package list
apt-get -y install tar gzip curl apache2 php5-pgsql libapache2-mod-php5 \ apt-get -y --force-yes install tar gzip curl apache2 php5-pgsql libapache2-mod-php5 \
php-pear php5-gd postgresql odbc-postgresql python libsoundtouch-ocaml \ php-pear php5-gd postgresql odbc-postgresql python libsoundtouch-ocaml \
libtaglib-ocaml libao-ocaml libmad-ocaml ecasound \ libtaglib-ocaml libao-ocaml libmad-ocaml ecasound \
libesd0 libportaudio2 libsamplerate0 rabbitmq-server patch \ libesd0 libportaudio2 libsamplerate0 rabbitmq-server patch \
php5-curl mpg123 monit python-virtualenv multitail libcamomile-ocaml-data \ php5-curl mpg123 monit python-virtualenv multitail libcamomile-ocaml-data \
libpulse0 vorbis-tools lsb-release lsof sudo mp3gain vorbisgain flac vorbis-tools \ libpulse0 vorbis-tools lsb-release lsof sudo mp3gain vorbisgain flac vorbis-tools \
pwgen pwgen libfaad2
#install packages with --force-yes option (this is useful in the case #install packages with --force-yes option (this is useful in the case
#of Debian, where these packages are unauthorized) #of Debian, where these packages are unauthorized)

View File

@ -44,7 +44,7 @@ libtaglib-ocaml libao-ocaml libmad-ocaml ecasound \
libesd0 libportaudio2 libsamplerate0 rabbitmq-server patch \ libesd0 libportaudio2 libsamplerate0 rabbitmq-server patch \
php5-curl mpg123 monit python-virtualenv multitail libcamomile-ocaml-data \ php5-curl mpg123 monit python-virtualenv multitail libcamomile-ocaml-data \
libpulse0 vorbis-tools lsb-release lsof sudo mp3gain vorbisgain flac vorbis-tools \ libpulse0 vorbis-tools lsb-release lsof sudo mp3gain vorbisgain flac vorbis-tools \
pwgen pwgen libfaad2
#install packages with --force-yes option (this is useful in the case #install packages with --force-yes option (this is useful in the case
#of Debian, where these packages are unauthorized) #of Debian, where these packages are unauthorized)

View File

@ -15,8 +15,6 @@ ALTER TABLE cc_files
DROP TABLE cc_access; DROP TABLE cc_access;
DROP SEQUENCE cc_access_id_seq;
CREATE FUNCTION airtime_to_int(chartoconvert character varying) RETURNS integer CREATE FUNCTION airtime_to_int(chartoconvert character varying) RETURNS integer
AS AS
'SELECT CASE WHEN trim($1) SIMILAR TO ''[0-9]+'' THEN CAST(trim($1) AS integer) ELSE NULL END;' 'SELECT CASE WHEN trim($1) SIMILAR TO ''[0-9]+'' THEN CAST(trim($1) AS integer) ELSE NULL END;'

View File

@ -2,6 +2,7 @@
from kombu.messaging import Exchange, Queue, Consumer from kombu.messaging import Exchange, Queue, Consumer
from kombu.connection import BrokerConnection from kombu.connection import BrokerConnection
from os.path import normpath from os.path import normpath
from mutagen.easymp4 import EasyMP4KeyError
import json import json
import os import os
@ -117,6 +118,10 @@ class AirtimeMessageReceiver(Loggable):
try: Metadata.write_unsafe(path=md_path, md=msg) try: Metadata.write_unsafe(path=md_path, md=msg)
except BadSongFile as e: except BadSongFile as e:
self.logger.info("Cannot find metadata file: '%s'" % e.path) self.logger.info("Cannot find metadata file: '%s'" % e.path)
except EasyMP4KeyError as e:
self.logger.info("Metadata instance not supported for this file '%s'" \
% e.path)
self.logger.info(str(e))
except Exception as e: except Exception as e:
# TODO : add md_path to problem path or something? # TODO : add md_path to problem path or something?
self.fatal_exception("Unknown error when writing metadata to: '%s'" self.fatal_exception("Unknown error when writing metadata to: '%s'"
@ -135,7 +140,7 @@ class AirtimeMessageReceiver(Loggable):
msg['directory']) msg['directory'])
self.new_watch(msg) self.new_watch(msg)
else: else:
self.__reFalsequest_now_bootstrap( directory=msg['directory'], self.__request_now_bootstrap( directory=msg['directory'],
all_files=restart) all_files=restart)
self.manager.add_watch_directory(msg['directory']) self.manager.add_watch_directory(msg['directory'])

View File

@ -110,7 +110,7 @@ class BaseEvent(Loggable):
# nothing to see here, please move along # nothing to see here, please move along
def morph_into(self, evt): def morph_into(self, evt):
self.logger.info("Morphing %s into %s" % ( str(self), str(evt) ) ) self.logger.info("Morphing %s into %s" % ( str(self), str(evt) ) )
self._raw_event = evt self._raw_event = evt._raw_event
self.path = evt.path self.path = evt.path
self.__class__ = evt.__class__ self.__class__ = evt.__class__
# Clean up old hook and transfer the new events hook # Clean up old hook and transfer the new events hook
@ -181,11 +181,14 @@ class MoveFile(BaseEvent, HasMetaData):
""" """
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(MoveFile, self).__init__(*args, **kwargs) super(MoveFile, self).__init__(*args, **kwargs)
def old_path(self):
return self._raw_event.src_pathname
def pack(self): def pack(self):
req_dict = {} req_dict = {}
req_dict['mode'] = u'moved' req_dict['mode'] = u'moved'
req_dict['MDATA_KEY_ORIGINAL_PATH'] = self.old_path()
req_dict['MDATA_KEY_FILEPATH'] = unicode( self.path )
req_dict['MDATA_KEY_MD5'] = self.metadata.extract()['MDATA_KEY_MD5'] req_dict['MDATA_KEY_MD5'] = self.metadata.extract()['MDATA_KEY_MD5']
req_dict['MDATA_KEY_FILEPATH'] = unicode( self.path )
return [req_dict] return [req_dict]
class ModifyFile(BaseEvent, HasMetaData): class ModifyFile(BaseEvent, HasMetaData):

View File

@ -231,6 +231,8 @@ class Manager(Loggable):
else: else:
self.logger.info("'%s' is not being watched, hence cannot be \ self.logger.info("'%s' is not being watched, hence cannot be \
removed" % watch_dir) removed" % watch_dir)
self.logger.info("The directories we are watching now are:")
self.logger.info( self.__wd_path )
def loop(self): def loop(self):
""" """

View File

@ -3,6 +3,7 @@ import mutagen
import math import math
import os import os
import copy import copy
from mutagen.easymp4 import EasyMP4KeyError
from media.monitor.exceptions import BadSongFile from media.monitor.exceptions import BadSongFile
from media.monitor.log import Loggable from media.monitor.log import Loggable
@ -150,12 +151,17 @@ class Metadata(Loggable):
""" """
if not os.path.exists(path): raise BadSongFile(path) if not os.path.exists(path): raise BadSongFile(path)
song_file = mutagen.File(path, easy=True) song_file = mutagen.File(path, easy=True)
ex = None
for airtime_k, airtime_v in md.iteritems(): for airtime_k, airtime_v in md.iteritems():
if airtime_k in airtime2mutagen: if airtime_k in airtime2mutagen:
# The unicode cast here is mostly for integers that need to be # The unicode cast here is mostly for integers that need to be
# strings # strings
song_file[ airtime2mutagen[airtime_k] ] = unicode(airtime_v) try:
song_file[ airtime2mutagen[airtime_k] ] = unicode(airtime_v)
except EasyMP4KeyError as e:
ex = e
song_file.save() song_file.save()
if ex: raise ex
def __init__(self, fpath): def __init__(self, fpath):
# Forcing the unicode through # Forcing the unicode through

View File

@ -20,7 +20,9 @@ from configobj import ConfigObj
from media.monitor.exceptions import FailedToSetLocale, FailedToCreateDir from media.monitor.exceptions import FailedToSetLocale, FailedToCreateDir
#supported_extensions = [u"mp3", u"ogg", u"oga"] #supported_extensions = [u"mp3", u"ogg", u"oga"]
supported_extensions = [u"mp3", u"ogg", u"oga", u"flac", u"aac", u"wav"] supported_extensions = [u"mp3", u"ogg", u"oga", u"flac", u"aac", u"wav",
u'm4a']
unicode_unknown = u'unknown' unicode_unknown = u'unknown'
path_md = ['MDATA_KEY_TITLE', 'MDATA_KEY_CREATOR', 'MDATA_KEY_SOURCE', path_md = ['MDATA_KEY_TITLE', 'MDATA_KEY_CREATOR', 'MDATA_KEY_SOURCE',