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

This commit is contained in:
Martin Konecny 2012-09-13 12:25:03 -04:00
commit e95933525b
12 changed files with 20 additions and 29 deletions

View File

@ -46,7 +46,7 @@ class Application_Common_Database
$new_params[$k] = $new_params[$v]; $new_params[$k] = $new_params[$v];
} else { } else {
foreach ( range(1,$matches_count) as $i ) { foreach ( range(1,$matches_count) as $i ) {
preg_replace( "/$k(\D)/", "$k.$i${1}", $sql, 1); preg_replace( "/$k(\D)/", "$k$i${1}", $sql, 1);
$new_params[ $k.$i ] = $v; $new_params[ $k.$i ] = $v;
} }
} }

View File

@ -564,7 +564,7 @@ class ApiController extends Zend_Controller_Action
// to some unique id. // to some unique id.
$request = $this->getRequest(); $request = $this->getRequest();
$responses = array(); $responses = array();
//$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 ($params 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

View File

@ -99,10 +99,7 @@ class LibraryController extends Zend_Controller_Action
protected function playlistUnknownError($e) protected function playlistUnknownError($e)
{ {
$this->view->error = "Something went wrong."; $this->view->error = "Something went wrong.";
Logging::info($e->getMessage());
Logging::info("{$e->getFile()}");
Logging::info("{$e->getLine()}");
Logging::info("{$e->getMessage()}");
} }
protected function createFullResponse($obj = null, $isJson = false) protected function createFullResponse($obj = null, $isJson = false)

View File

@ -178,7 +178,7 @@ class LoginController extends Zend_Controller_Action
$authAdapter->setIdentity($user->getDbLogin()) $authAdapter->setIdentity($user->getDbLogin())
->setCredential($form->password->getValue()); ->setCredential($form->password->getValue());
$result = $zend_auth->authenticate($authAdapter); $zend_auth->authenticate($authAdapter);
//all info about this user from the login table omit only the password //all info about this user from the login table omit only the password
$userInfo = $authAdapter->getResultRowObject(null, 'password'); $userInfo = $authAdapter->getResultRowObject(null, 'password');

View File

@ -34,7 +34,7 @@ class PlaylistController extends Zend_Controller_Action
$obj = null; $obj = null;
$objInfo = Application_Model_Library::getObjInfo($p_type); $objInfo = Application_Model_Library::getObjInfo($p_type);
$obj_sess = new Zend_Session_Namespace(UI_PLAYLISTCONTROLLER_OBJ_SESSNAME); $obj_sess = new Zend_Session_Namespace( UI_PLAYLISTCONTROLLER_OBJ_SESSNAME);
if (isset($obj_sess->id)) { if (isset($obj_sess->id)) {
$obj = new $objInfo['className']($obj_sess->id); $obj = new $objInfo['className']($obj_sess->id);
@ -63,7 +63,8 @@ class PlaylistController extends Zend_Controller_Action
unset($this->view->obj); unset($this->view->obj);
} }
private function createFullResponse($obj = null, $isJson = false, $formIsValid = false) private function createFullResponse($obj = null, $isJson = false,
$formIsValid = false)
{ {
$isBlock = false; $isBlock = false;
$viewPath = 'playlist/playlist.phtml'; $viewPath = 'playlist/playlist.phtml';
@ -141,10 +142,7 @@ class PlaylistController extends Zend_Controller_Action
private function playlistUnknownError($e) private function playlistUnknownError($e)
{ {
$this->view->error = "Something went wrong."; $this->view->error = "Something went wrong.";
Logging::info($e->getMessage());
Logging::info("{$e->getFile()}");
Logging::info("{$e->getLine()}");
Logging::info("{$e->getMessage()}");
} }
private function wrongTypeToBlock($obj) private function wrongTypeToBlock($obj)
@ -203,17 +201,18 @@ class PlaylistController extends Zend_Controller_Action
public function deleteAction() public function deleteAction()
{ {
$ids = $this->_getParam('ids'); $ids = $this->_getParam('ids');
$ids = (!is_array($ids)) ? array($ids) : $ids; $ids = (!is_array($ids)) ? array($ids) : $ids;
$type = $this->_getParam('type'); $type = $this->_getParam('type');
$obj = null; $obj = null;
$objInfo = Application_Model_Library::getObjInfo($type); $objInfo = Application_Model_Library::getObjInfo($type);
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$obj_sess = new Zend_Session_Namespace(UI_PLAYLISTCONTROLLER_OBJ_SESSNAME); $obj_sess = new Zend_Session_Namespace(
UI_PLAYLISTCONTROLLER_OBJ_SESSNAME);
try { try {
Logging::info("Currently active {$type} {$obj_sess->id}"); Logging::info("Currently active {$type} {$obj_sess->id}");

View File

@ -392,7 +392,6 @@ class ScheduleController extends Zend_Controller_Action
{ {
$showInstanceId = $this->sched_sess->showInstanceId; $showInstanceId = $this->sched_sess->showInstanceId;
$group_id = $this->_getParam('groupId'); $group_id = $this->_getParam('groupId');
$search = $this->_getParam('search', 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);
@ -530,9 +529,6 @@ class ScheduleController extends Zend_Controller_Action
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true; $isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
$showInstanceId = $this->_getParam('id'); $showInstanceId = $this->_getParam('id');
// $type is used to determine if this edit is for the specific instance or for all
// repeating shows. It's value is either "instance","rebroadcast", or "all"
$type = $this->_getParam('type');
$this->view->action = "edit-show"; $this->view->action = "edit-show";
try { try {

View File

@ -103,9 +103,7 @@ class UserController extends Zend_Controller_Action
{ {
// action body // action body
$delId = $this->_getParam('id'); $delId = $this->_getParam('id');
$valid_actions = array("delete_cascade", "reassign_to"); $valid_actions = array("delete_cascade", "reassign_to");
$files_action = $this->_getParam('deleted_files'); $files_action = $this->_getParam('deleted_files');
# TODO : remove this. we only use default for now not to break the UI. # TODO : remove this. we only use default for now not to break the UI.

View File

@ -446,7 +446,6 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
foreach ($data['criteria'] as $rowKey=>$row) { foreach ($data['criteria'] as $rowKey=>$row) {
foreach ($row as $key=>$d) { foreach ($row as $key=>$d) {
$element = $this->getElement("sp_criteria_field_".$rowKey."_".$key); $element = $this->getElement("sp_criteria_field_".$rowKey."_".$key);
$error = array();
// check for not selected select box // check for not selected select box
if ($d['sp_criteria_field'] == "0" || $d['sp_criteria_modifier'] == "0") { if ($d['sp_criteria_field'] == "0" || $d['sp_criteria_modifier'] == "0") {
$element->addError("You must select Criteria and Modifier"); $element->addError("You must select Criteria and Modifier");

View File

@ -9,7 +9,7 @@ $(document).ready(function() {
unique_names : 'true', unique_names : 'true',
multiple_queues : 'true', multiple_queues : 'true',
filters : [ filters : [
{title: "Audio Files", extensions: "ogg,mp3,oga,flac,aac,wav,m4a"} {title: "Audio Files", extensions: "ogg,mp3,oga,flac,wav,m4a,mp4"}
] ]
}); });

View File

@ -128,6 +128,7 @@ class AirtimeMessageReceiver(Loggable):
% md_path, e) % md_path, e)
def new_watch(self, msg, restart=False): def new_watch(self, msg, restart=False):
msg['directory'] = normpath(msg['directory'])
self.logger.info("Creating watch for directory: '%s'" % self.logger.info("Creating watch for directory: '%s'" %
msg['directory']) msg['directory'])
if not os.path.exists(msg['directory']): if not os.path.exists(msg['directory']):
@ -145,6 +146,7 @@ class AirtimeMessageReceiver(Loggable):
self.manager.add_watch_directory(msg['directory']) self.manager.add_watch_directory(msg['directory'])
def remove_watch(self, msg): def remove_watch(self, msg):
msg['directory'] = normpath(msg['directory'])
self.logger.info("Removing watch from directory: '%s'" % self.logger.info("Removing watch from directory: '%s'" %
msg['directory']) msg['directory'])
self.manager.remove_watch_directory(msg['directory']) self.manager.remove_watch_directory(msg['directory'])

View File

@ -20,8 +20,8 @@ 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"wav",
u'm4a'] u'm4a', u'mp4']
unicode_unknown = u'unknown' unicode_unknown = u'unknown'

View File

@ -29,7 +29,7 @@ except Exception, e:
print('Error loading config file: %s', e) print('Error loading config file: %s', e)
sys.exit() sys.exit()
api_client = apc.api_client_factory(config) api_client = apc.AirtimeApiClient(config)
#helper functions #helper functions
# copy or move files # copy or move files