CC-1665: Scheduled stream rebroadcasting and recording
-use sessions to determine currently open object in Library
This commit is contained in:
parent
20cfd01f80
commit
a1b91aebbd
6 changed files with 47 additions and 129 deletions
|
@ -8,7 +8,7 @@ require_once 'formatters/LengthFormatter.php';
|
|||
* @copyright 2010 Sourcefabric O.P.S.
|
||||
* @license http://www.gnu.org/licenses/gpl.txt
|
||||
*/
|
||||
class Application_Model_Block
|
||||
class Application_Model_Block implements Application_Model_LibraryEditable
|
||||
{
|
||||
/**
|
||||
* propel connection object.
|
||||
|
@ -839,7 +839,7 @@ EOT;
|
|||
return $this->$method();
|
||||
}
|
||||
|
||||
public function setMetaData($category, $value)
|
||||
public function setMetadata($category, $value)
|
||||
{
|
||||
$cat = $this->categories[$category];
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ require_once 'formatters/LengthFormatter.php';
|
|||
* @copyright 2010 Sourcefabric O.P.S.
|
||||
* @license http://www.gnu.org/licenses/gpl.txt
|
||||
*/
|
||||
class Application_Model_Playlist
|
||||
class Application_Model_Playlist implements Application_Model_LibraryEditable
|
||||
{
|
||||
/**
|
||||
* propel connection object.
|
||||
|
@ -270,8 +270,8 @@ SQL;
|
|||
}
|
||||
|
||||
// returns true/false and ids of dynamic blocks
|
||||
public function hasDynamicBlock(){
|
||||
$ids = $this->getIdsOfDynamicBlocks();
|
||||
public function hasDynamicBlock(){
|
||||
$ids = $this->getIdsOfDynamicBlocks();
|
||||
if (count($ids) > 0) {
|
||||
return true;
|
||||
} else {
|
||||
|
@ -280,10 +280,10 @@ SQL;
|
|||
}
|
||||
|
||||
public function getIdsOfDynamicBlocks() {
|
||||
$sql = "SELECT bl.id FROM cc_playlistcontents as pc
|
||||
JOIN cc_block as bl ON pc.type=2 AND pc.block_id=bl.id AND bl.type='dynamic'
|
||||
WHERE playlist_id={$this->id} AND pc.type=2";
|
||||
$r = $this->con->query($sql);
|
||||
$sql = "SELECT bl.id FROM cc_playlistcontents as pc
|
||||
JOIN cc_block as bl ON pc.type=2 AND pc.block_id=bl.id AND bl.type='dynamic'
|
||||
WHERE playlist_id={$this->id} AND pc.type=2";
|
||||
$r = $this->con->query($sql);
|
||||
$result = $r->fetchAll(PDO::FETCH_ASSOC);
|
||||
return $result;
|
||||
}
|
||||
|
@ -425,7 +425,7 @@ SQL;
|
|||
Logging::log("at position {$pos}");
|
||||
|
||||
foreach ($p_items as $ac) {
|
||||
$res = $this->insertPlaylistElement($this->buildEntry($ac, $pos));
|
||||
$res = $this->insertPlaylistElement($this->buildEntry($ac, $pos));
|
||||
$pos = $pos + 1;
|
||||
Logging::log("Adding $ac[1] $ac[0]");
|
||||
|
||||
|
@ -835,7 +835,7 @@ SQL;
|
|||
return $this->$method();
|
||||
}
|
||||
|
||||
public function setMetaData($category, $value)
|
||||
public function setMetadata($category, $value)
|
||||
{
|
||||
$cat = $this->categories[$category];
|
||||
|
||||
|
@ -890,26 +890,13 @@ SQL;
|
|||
return $leftOvers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all files from playlist
|
||||
* @param int $p_playlistId
|
||||
*/
|
||||
public function deleteAllFilesFromPlaylist()
|
||||
/**
|
||||
* Delete all files from playlist
|
||||
* @param int $p_playlistId
|
||||
*/
|
||||
public function deleteAllFilesFromPlaylist()
|
||||
{
|
||||
CcPlaylistcontentsQuery::create()->findByDbPlaylistId($this->id)->delete();
|
||||
}
|
||||
|
||||
public static function getObjInfo($p_type)
|
||||
{
|
||||
$info = array();
|
||||
|
||||
if (strcmp($p_type, 'playlist')==0) {
|
||||
$info['className'] = 'Application_Model_Playlist';
|
||||
} else {
|
||||
$info['className'] = 'Application_Model_Block';
|
||||
}
|
||||
|
||||
return $info;
|
||||
CcPlaylistcontentsQuery::create()->findByDbPlaylistId($this->id)->delete();
|
||||
}
|
||||
|
||||
} // class Playlist
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
class Application_Model_Webstream{
|
||||
|
||||
class Application_Model_Webstream implements Application_Model_LibraryEditable
|
||||
{
|
||||
private $id;
|
||||
|
||||
public function __construct($webstream)
|
||||
|
@ -145,15 +145,6 @@ class Application_Model_Webstream{
|
|||
|
||||
$id = $parameters["id"];
|
||||
|
||||
if (!is_null($id)) {
|
||||
// user has performed a create stream action instead of edit
|
||||
// stream action. Check if user has the rights to edit this stream.
|
||||
|
||||
Logging::log("CREATE");
|
||||
} else {
|
||||
Logging::log("EDIT");
|
||||
}
|
||||
|
||||
return array($valid, $mime, $di);
|
||||
}
|
||||
|
||||
|
@ -168,6 +159,18 @@ class Application_Model_Webstream{
|
|||
return true;
|
||||
}
|
||||
|
||||
public function setMetadata($key, $val)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function setName($name)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static function discoverStreamMime($url)
|
||||
{
|
||||
$headers = get_headers($url);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue