Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
4fc278a55a
5 changed files with 10 additions and 9 deletions
|
@ -441,6 +441,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
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_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
|
||||||
|
@ -563,13 +564,14 @@ 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
|
||||||
// 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);
|
||||||
|
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) ) {
|
||||||
Logging::info("Received bad request(key=$k), no 'mode' parameter. Bad request is:");
|
Logging::info("Received bad request(key=$k), no 'mode' parameter. Bad request is:");
|
||||||
|
|
|
@ -270,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();
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -210,7 +210,7 @@ FROM cc_blockcontents AS pc
|
||||||
LEFT JOIN cc_files AS f ON pc.file_id=f.id
|
LEFT JOIN cc_files AS f ON pc.file_id=f.id
|
||||||
LEFT JOIN cc_block AS bl ON pc.block_id = bl.id
|
LEFT JOIN cc_block AS bl ON pc.block_id = bl.id
|
||||||
WHERE pc.block_id = :block_id
|
WHERE pc.block_id = :block_id
|
||||||
ORDER BY pc.position;
|
ORDER BY pc.position
|
||||||
SQL;
|
SQL;
|
||||||
|
|
||||||
$rows = Application_Common_Database::prepareAndExecute($sql, array(':block_id'=>$this->id));
|
$rows = Application_Common_Database::prepareAndExecute($sql, array(':block_id'=>$this->id));
|
||||||
|
|
|
@ -522,7 +522,6 @@ SQL;
|
||||||
*/
|
*/
|
||||||
public static function getItems($p_startTime, $p_endTime)
|
public static function getItems($p_startTime, $p_endTime)
|
||||||
{
|
{
|
||||||
global $CC_CONFIG;
|
|
||||||
$baseQuery = <<<SQL
|
$baseQuery = <<<SQL
|
||||||
SELECT st.file_id AS file_id,
|
SELECT st.file_id AS file_id,
|
||||||
st.id AS id,
|
st.id AS id,
|
||||||
|
@ -556,8 +555,10 @@ SQL;
|
||||||
|
|
||||||
$sql = $baseQuery." ".$predicates;
|
$sql = $baseQuery." ".$predicates;
|
||||||
|
|
||||||
$rows = Application_Common_Database::prepareAndExecute($sql,
|
$rows = Application_Common_Database::prepareAndExecute($sql, array(
|
||||||
array(':startTime1'=>$p_startTime, ':endTime'=>$p_endTime, ':startTime2'=>$p_startTime));
|
':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());
|
||||||
|
@ -572,7 +573,7 @@ WHERE st.ends > :startTime1
|
||||||
ORDER BY st.starts LIMIT 3
|
ORDER BY st.starts LIMIT 3
|
||||||
SQL;
|
SQL;
|
||||||
|
|
||||||
$sql = " ".$baseQuery." ".$predicates." ";
|
$sql = $baseQuery." ".$predicates." ";
|
||||||
$rows = Application_Common_Database::prepareAndExecute($sql,
|
$rows = Application_Common_Database::prepareAndExecute($sql,
|
||||||
array(
|
array(
|
||||||
':startTime1' => $p_startTime,
|
':startTime1' => $p_startTime,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue