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);