cc-3476: dynamic timeout
This commit is contained in:
parent
2070de03ce
commit
c301cd5256
3 changed files with 23 additions and 5 deletions
|
@ -292,5 +292,17 @@ class Application_Model_DateHelper
|
|||
return $p_dateString;
|
||||
return self::ConvertToUtcDateTime($p_dateString)->format($p_format);
|
||||
}
|
||||
|
||||
/*
|
||||
* Example input: "00:02:32.746562". Output is a DateInterval object
|
||||
* representing that 2 minute, 32.746562 second interval.
|
||||
*
|
||||
*/
|
||||
public static function getDateIntervalFromString($p_interval){
|
||||
list($hour_min_sec, $subsec) = explode(".", $p_interval);
|
||||
list($hour, $min, $sec) = explode(":", $hour_min_sec);
|
||||
|
||||
return new DateInterval("PT{$hour}H{$min}M{$sec}S");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -645,16 +645,19 @@ class Application_Model_Schedule {
|
|||
$uri = $storedFile->getFilePath();
|
||||
|
||||
$showEndDateTime = new DateTime($item["show_end"], $utcTimeZone);
|
||||
$trackStartDateTime = new DateTime($item["start"], $utcTimeZone);
|
||||
$trackEndDateTime = new DateTime($item["end"], $utcTimeZone);
|
||||
|
||||
/* Note: cue_out and end are always the same. */
|
||||
/* TODO: Not all tracks will have "show_end" */
|
||||
|
||||
if ($trackEndDateTime->getTimestamp() > $showEndDateTime->getTimestamp()){
|
||||
$diff = $trackEndDateTime->getTimestamp() - $showEndDateTime->getTimestamp();
|
||||
//assuming ends takes cue_out into assumption
|
||||
$item["cue_out"] = $item["cue_out"] - $diff;
|
||||
$di = $trackStartDateTime->diff($showEndDateTime);
|
||||
|
||||
$item["cue_out"] = $di->format("%H:%i:%s").".000";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$start = Application_Model_Schedule::AirtimeTimeToPypoTime($item["start"]);
|
||||
$data["media"][$start] = array(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue