CC-4321: NowPlaying: Cancelling Webstream has no effect and results in OnAir being grayed out
-fixed
This commit is contained in:
parent
79b6d13c16
commit
c043053407
3 changed files with 43 additions and 32 deletions
|
@ -14,11 +14,8 @@ class Application_Model_Schedule
|
|||
$sql = "SELECT COUNT(*) FROM ".$CC_CONFIG["scheduleTable"]
|
||||
." WHERE file_id = {$p_fileId} AND ends > NOW() AT TIME ZONE 'UTC'";
|
||||
$count = $con->query($sql)->fetchColumn(0);
|
||||
if (is_numeric($count) && ($count != '0')) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return (is_numeric($count) && ($count != '0'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,7 +24,11 @@ class Application_Model_Scheduler
|
|||
{
|
||||
$this->con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME);
|
||||
|
||||
$this->epochNow = microtime(true);
|
||||
//subtracting one because sometimes when we cancel a track, we set its end time
|
||||
//to epochNow and then send the new schedule to pypo. Sometimes the currently cancelled
|
||||
//track can still be included in the new schedule because it may have a few ms left to play.
|
||||
//subtracting 1 second from epochNow resolves this issue.
|
||||
$this->epochNow = microtime(true)-1;
|
||||
$this->nowDT = DateTime::createFromFormat("U.u", $this->epochNow, new DateTimeZone("UTC"));
|
||||
|
||||
if ($this->nowDT === false) {
|
||||
|
@ -324,6 +328,8 @@ class Application_Model_Scheduler
|
|||
* @param int $showInstance
|
||||
* @param array $exclude
|
||||
* ids of sched items to remove from the calulation.
|
||||
* This function squeezes all items of a show together so that
|
||||
* there are no gaps between them.
|
||||
*/
|
||||
private function removeGaps($showInstance, $exclude=null)
|
||||
{
|
||||
|
@ -665,7 +671,7 @@ class Application_Model_Scheduler
|
|||
//playing.
|
||||
$removedItem->setDbCueOut($cueout)
|
||||
->setDbClipLength($cliplength)
|
||||
->setDbEnds($this->nowDT->sub(new DateInteval("PT1S")))
|
||||
->setDbEnds($this->nowDT)
|
||||
->save($this->con);
|
||||
} else {
|
||||
$removedItem->delete($this->con);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue