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];
} else {
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;
}
}

View File

@ -564,7 +564,7 @@ class ApiController extends Zend_Controller_Action
// to some unique id.
$request = $this->getRequest();
$responses = array();
//$params = $request->getParams();
$params = $request->getParams();
$valid_modes = array('delete_dir', 'delete', 'moved', 'modify', 'create');
foreach ($params as $k => $raw_json) {
// 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)
{
$this->view->error = "Something went wrong.";
Logging::info("{$e->getFile()}");
Logging::info("{$e->getLine()}");
Logging::info("{$e->getMessage()}");
Logging::info($e->getMessage());
}
protected function createFullResponse($obj = null, $isJson = false)

View File

@ -178,7 +178,7 @@ class LoginController extends Zend_Controller_Action
$authAdapter->setIdentity($user->getDbLogin())
->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
$userInfo = $authAdapter->getResultRowObject(null, 'password');

View File

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

View File

@ -103,9 +103,7 @@ class UserController extends Zend_Controller_Action
{
// action body
$delId = $this->_getParam('id');
$valid_actions = array("delete_cascade", "reassign_to");
$files_action = $this->_getParam('deleted_files');
# 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 ($row as $key=>$d) {
$element = $this->getElement("sp_criteria_field_".$rowKey."_".$key);
$error = array();
// check for not selected select box
if ($d['sp_criteria_field'] == "0" || $d['sp_criteria_modifier'] == "0") {
$element->addError("You must select Criteria and Modifier");

View File

@ -9,7 +9,7 @@ $(document).ready(function() {
unique_names : 'true',
multiple_queues : 'true',
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)
def new_watch(self, msg, restart=False):
msg['directory'] = normpath(msg['directory'])
self.logger.info("Creating watch for directory: '%s'" %
msg['directory'])
if not os.path.exists(msg['directory']):
@ -145,6 +146,7 @@ class AirtimeMessageReceiver(Loggable):
self.manager.add_watch_directory(msg['directory'])
def remove_watch(self, msg):
msg['directory'] = normpath(msg['directory'])
self.logger.info("Removing watch from directory: '%s'" %
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
#supported_extensions = [u"mp3", u"ogg", u"oga"]
supported_extensions = [u"mp3", u"ogg", u"oga", u"flac", u"aac", u"wav",
u'm4a']
supported_extensions = [u"mp3", u"ogg", u"oga", u"flac", u"wav",
u'm4a', u'mp4']
unicode_unknown = u'unknown'

View File

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