CC-1985 : Automatic rebroadcast of recorded content
scheduling the recorded file in any rebroadcast shows.
This commit is contained in:
parent
864cda6c34
commit
fae71ed051
5 changed files with 39 additions and 56 deletions
|
@ -652,8 +652,8 @@ class ShowInstance {
|
|||
return $res;
|
||||
}
|
||||
|
||||
public function addPlaylistToShow($plId) {
|
||||
|
||||
public function addPlaylistToShow($plId)
|
||||
{
|
||||
$sched = new ScheduleGroup();
|
||||
$lastGroupId = $this->getLastGroupId();
|
||||
|
||||
|
@ -666,6 +666,20 @@ class ShowInstance {
|
|||
}
|
||||
}
|
||||
|
||||
public function addFileToShow($file_id)
|
||||
{
|
||||
$sched = new ScheduleGroup();
|
||||
$lastGroupId = $this->getLastGroupId();
|
||||
|
||||
if(is_null($lastGroupId)) {
|
||||
|
||||
$groupId = $sched->add($this->_instanceId, $this->getShowStart(), $file_id);
|
||||
}
|
||||
else {
|
||||
$groupId = $sched->addFileAfter($this->_instanceId, $lastGroupId, $file_id);
|
||||
}
|
||||
}
|
||||
|
||||
public function scheduleShow($plIds) {
|
||||
|
||||
foreach($plIds as $plId) {
|
||||
|
@ -712,7 +726,17 @@ class ShowInstance {
|
|||
$showInstance = CcShowInstancesQuery::create()
|
||||
->findPK($this->_instanceId);
|
||||
$showInstance->setDbRecordedFile($file_id)
|
||||
->save();
|
||||
->save();
|
||||
|
||||
$rebroadcasts = CcShowInstancesQuery::create()
|
||||
->filterByDbOriginalShow($this->_instanceId)
|
||||
->find();
|
||||
|
||||
foreach ($rebroadcasts as $rebroadcast) {
|
||||
|
||||
$rebroad = new ShowInstance($rebroadcast->getDbId());
|
||||
$rebroad->addFileToShow($file_id);
|
||||
}
|
||||
}
|
||||
|
||||
public function getTimeScheduled() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue