Merge pull request #707 from Robbt/intro-playlist
Add Intro and Outro playlist to Autoloading Playlists
This commit is contained in:
commit
4d0fea34fc
8 changed files with 91 additions and 19 deletions
|
@ -1776,7 +1776,6 @@ SQL;
|
|||
|
||||
// construct limit restriction
|
||||
$limits = array();
|
||||
|
||||
if (isset($storedCrit['limit'])) {
|
||||
if ($storedCrit['limit']['modifier'] == "items") {
|
||||
$limits['time'] = 1440 * 60;
|
||||
|
|
|
@ -387,6 +387,26 @@ class Application_Model_Preference
|
|||
return $val === '1' ? true : false;
|
||||
}
|
||||
|
||||
public static function GetIntroPlaylist()
|
||||
{
|
||||
return self::getValue("intro_playlist");
|
||||
}
|
||||
|
||||
public static function GetOutroPlaylist()
|
||||
{
|
||||
return self::getValue("outro_playlist");
|
||||
}
|
||||
|
||||
|
||||
public static function SetIntroPlaylist($playlist)
|
||||
{
|
||||
self::setValue("intro_playlist", $playlist);
|
||||
}
|
||||
|
||||
public static function SetOutroPlaylist($playlist)
|
||||
{
|
||||
self::setValue("outro_playlist", $playlist);
|
||||
}
|
||||
|
||||
public static function SetPhone($phone)
|
||||
{
|
||||
|
|
|
@ -214,7 +214,6 @@ final class Application_Model_Scheduler
|
|||
private function retrieveMediaFiles($id, $type, $show)
|
||||
{
|
||||
$files = array();
|
||||
|
||||
if ($type === "audioclip") {
|
||||
$file = CcFilesQuery::create()->findPK($id, $this->con);
|
||||
|
||||
|
|
|
@ -242,9 +242,30 @@ SQL;
|
|||
array(array("id" => $lastid, "instance" => $id, "timestamp" => $ts)),
|
||||
array(array("id" => $pl_id, "type" => "playlist"))
|
||||
);
|
||||
// doing this to update the database schedule so that subsequent adds will work.
|
||||
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME);
|
||||
$this->_showInstance->updateScheduleStatus($con);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add a playlist as the first item of the current show.
|
||||
*
|
||||
* @param int $plId
|
||||
* Playlist ID.
|
||||
*/
|
||||
public function addPlaylistToShowStart($pl_id, $checkUserPerm = true)
|
||||
{
|
||||
$ts = intval($this->_showInstance->getDbLastScheduled("U")) ? : 0;
|
||||
$id = $this->_showInstance->getDbId();
|
||||
$scheduler = new Application_Model_Scheduler($checkUserPerm);
|
||||
$scheduler->scheduleAfter(
|
||||
array(array("id" => 0, "instance" => $id, "timestamp" => $ts)),
|
||||
array(array("id" => $pl_id, "type" => "playlist"))
|
||||
);
|
||||
// doing this to update the database schedule so that subsequent adds will work.
|
||||
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME);
|
||||
$this->_showInstance->updateScheduleStatus($con);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue