From 79b6d13c168d7b9292e551f7221a1c5c2fbcc0a7 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Thu, 30 Aug 2012 17:52:39 -0400 Subject: [PATCH] CC-4321: NowPlaying: Cancelling Webstream has no effect and results in OnAir being grayed out -set DbEnds to 1 second in the past when cancelling stream --- airtime_mvc/application/models/Schedule.php | 2 +- airtime_mvc/application/models/Scheduler.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index a5c532c34..fdbec24b7 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -605,7 +605,7 @@ SQL; } // Scheduler wants everything in a playlist - $items = Application_Model_Schedule::GetItems($range_start, $range_end); + $items = self::GetItems($range_start, $range_end); $data = array(); $utcTimeZone = new DateTimeZone("UTC"); diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php index b47e2ad38..1944cbd58 100644 --- a/airtime_mvc/application/models/Scheduler.php +++ b/airtime_mvc/application/models/Scheduler.php @@ -660,9 +660,12 @@ class Application_Model_Scheduler $cueOutSec = bcadd($cueinSec , $length, 6); $cueout = Application_Common_DateHelper::secondsToPlaylistTime($cueOutSec); + //Set DbEnds - 1 second because otherwise there can be a timing issue + //when sending the new schedule to Pypo where Pypo thinks the track is still + //playing. $removedItem->setDbCueOut($cueout) ->setDbClipLength($cliplength) - ->setDbEnds($this->nowDT) + ->setDbEnds($this->nowDT->sub(new DateInteval("PT1S"))) ->save($this->con); } else { $removedItem->delete($this->con);