CC-5138: Linked Show: Time limitation exceeds when adding 24 hours smart block into daily repeating & linked shows
Calculate crossfades during insert instead of after
This commit is contained in:
parent
f23fc472ef
commit
cee74b59f9
1 changed files with 5 additions and 11 deletions
|
@ -591,6 +591,7 @@ class Application_Model_Scheduler
|
||||||
$instances = Application_Common_Database::prepareAndExecute(
|
$instances = Application_Common_Database::prepareAndExecute(
|
||||||
$instance_sql);
|
$instance_sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($instances as &$instance) {
|
foreach($instances as &$instance) {
|
||||||
$instanceId = $instance["id"];
|
$instanceId = $instance["id"];
|
||||||
if ($id !== 0) {
|
if ($id !== 0) {
|
||||||
|
@ -619,6 +620,7 @@ class Application_Model_Scheduler
|
||||||
|
|
||||||
//show is empty so start position counter at 0
|
//show is empty so start position counter at 0
|
||||||
$pos = 0;
|
$pos = 0;
|
||||||
|
$adjustSched = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array($instanceId, $affectedShowInstances)) {
|
if (!in_array($instanceId, $affectedShowInstances)) {
|
||||||
|
@ -651,6 +653,7 @@ class Application_Model_Scheduler
|
||||||
$doInsert = false;
|
$doInsert = false;
|
||||||
$doUpdate = false;
|
$doUpdate = false;
|
||||||
$values = array();
|
$values = array();
|
||||||
|
|
||||||
foreach ($filesToInsert as &$file) {
|
foreach ($filesToInsert as &$file) {
|
||||||
//item existed previously and is being moved.
|
//item existed previously and is being moved.
|
||||||
//need to keep same id for resources if we want REST.
|
//need to keep same id for resources if we want REST.
|
||||||
|
@ -742,16 +745,9 @@ class Application_Model_Scheduler
|
||||||
$update_sql, array(), Application_Common_Database::EXECUTE);
|
$update_sql, array(), Application_Common_Database::EXECUTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
//$nextStartDT = $this->findTimeDifference($endTimeDT, $this->crossfadeDuration);
|
$nextStartDT = $this->findTimeDifference($endTimeDT, $this->crossfadeDuration);
|
||||||
$nextStartDT = $endTimeDT;
|
|
||||||
$pos++;
|
$pos++;
|
||||||
|
|
||||||
/* If we are adjusting start and end times for items
|
|
||||||
* after the insert location, we need to exclude the
|
|
||||||
* schedule item we just inserted because it has correct
|
|
||||||
* start and end times*/
|
|
||||||
//$excludeIds[] = $lastInsertId;
|
|
||||||
|
|
||||||
}//all files have been inserted/moved
|
}//all files have been inserted/moved
|
||||||
if ($doInsert) {
|
if ($doInsert) {
|
||||||
$insert_sql = "INSERT INTO cc_schedule ".
|
$insert_sql = "INSERT INTO cc_schedule ".
|
||||||
|
@ -807,15 +803,13 @@ class Application_Model_Scheduler
|
||||||
Application_Common_Database::prepareAndExecute(
|
Application_Common_Database::prepareAndExecute(
|
||||||
$update_sql, array(), Application_Common_Database::EXECUTE);
|
$update_sql, array(), Application_Common_Database::EXECUTE);
|
||||||
|
|
||||||
$nextStartDT = $endTimeDT;
|
$nextStartDT = $this->findTimeDifference($endTimeDT, $this->crossfadeDuration);
|
||||||
$pos++;
|
$pos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pend = microtime(true);
|
$pend = microtime(true);
|
||||||
Logging::debug("adjusting all following items.");
|
Logging::debug("adjusting all following items.");
|
||||||
Logging::debug(floatval($pend) - floatval($pstart));
|
Logging::debug(floatval($pend) - floatval($pstart));
|
||||||
|
|
||||||
$this->calculateCrossfades($instanceId);
|
|
||||||
}
|
}
|
||||||
}//for each instance
|
}//for each instance
|
||||||
}//for each schedule location
|
}//for each schedule location
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue