CC-5719: Incorrect show content start time

The show content was getting recalculated twice sometimes.
So if the difference between the original and now show start
date-time and was 2 hours, the scheduled content would have
a difference of 4 hours
This commit is contained in:
drigato 2014-03-04 11:29:49 -05:00
parent b433a529ab
commit 7660e0cd84
2 changed files with 12 additions and 17 deletions

View File

@ -304,24 +304,20 @@ class Application_Service_SchedulerService
private static function replaceInstanceContentCheck($currentShowStamp, $showStamp)
{
/*$currentShowStamp = CcScheduleQuery::create()
->filterByDbInstanceId($ccShowInstance->getDbId())
->orderByDbStarts()
->find();*/
$counter = 0;
foreach ($showStamp as $item) {
if ($item["file_id"] != $currentShowStamp[$counter]["file_id"] ||
$item["stream_id"] != $currentShowStamp[$counter]["stream_id"]) {
/*CcScheduleQuery::create()
->filterByDbInstanceId($ccShowInstance->getDbId())
->delete();*/
$delete_sql = "DELETE FROM cc_schedule ".
"WHERE instance_id = {$currentShowStamp[$counter]["instance_id"]}";
Application_Common_Database::prepareAndExecute(
$delete_sql, array(), Application_Common_Database::EXECUTE);
return true;
}
/*CcScheduleQuery::create()
->filterByDbInstanceId($ccShowInstance->getDbId())
->delete();*/
$delete_sql = "DELETE FROM cc_schedule ".
"WHERE instance_id = {$currentShowStamp[$counter]["instance_id"]}";
Application_Common_Database::prepareAndExecute(
$delete_sql, array(), Application_Common_Database::EXECUTE);
return true;
}
$counter += 1;
}
/* If we get here, the content in the show instance is the same

View File

@ -534,12 +534,11 @@ SQL;
//check if this is null if "no end"
$currentShowEndDateTime = $this->getRepeatingEndDate();
if ($currentShowEndDateTime != $endDateTime) {
if ($endDateTime && $currentShowEndDateTime != $endDateTime) {
$endDate = clone $endDateTime;
$endDate->setTimezone(new DateTimeZone("UTC"));
//show "No End" option was toggled
//show's "No End" option was toggled
//or the end date comes earlier
if (is_null($currentShowEndDateTime) || ($endDateTime < $currentShowEndDateTime)) {
//"No End" option was unchecked so we need to delete the