CC-5904: New linked show instances may get an old copy of the schedule

Change the way get the show stamp
This commit is contained in:
drigato 2014-08-18 19:27:42 -04:00
parent 9a6e617f7c
commit 08e82cb32e
1 changed files with 4 additions and 2 deletions

View File

@ -199,8 +199,10 @@ class Application_Service_SchedulerService
* sorted the instances by desc order, we are using the most recent * sorted the instances by desc order, we are using the most recent
* instance, which will have the most up to date schedule. * instance, which will have the most up to date schedule.
*/ */
$showsPopulatedUntil = Application_Model_Preference::GetShowsPopulatedUntil();
$showStamp_sql = "SELECT * FROM cc_schedule ". $showStamp_sql = "SELECT * FROM cc_schedule ".
"WHERE instance_id = $mostRecentInstanceId ". "WHERE starts < '{$showsPopulatedUntil->format('Y-m-d H:i:s')}' ".
"ORDER BY starts"; "ORDER BY starts";
$showStamp = Application_Common_Database::prepareAndExecute( $showStamp = Application_Common_Database::prepareAndExecute(
$showStamp_sql); $showStamp_sql);
@ -232,7 +234,7 @@ class Application_Service_SchedulerService
if (count($showInstanceContents) < 1 || if (count($showInstanceContents) < 1 ||
self::replaceInstanceContentCheck($showInstanceContents, $showStamp, $id)) self::replaceInstanceContentCheck($showInstanceContents, $showStamp, $id))
{ {
Logging::info($showStamp_sql);
$instanceStart_sql = "SELECT starts FROM cc_show_instances ". $instanceStart_sql = "SELECT starts FROM cc_show_instances ".
"WHERE id = {$id} ". "WHERE id = {$id} ".
"ORDER BY starts"; "ORDER BY starts";