CC-4703: Now Playing duration column ignores any cue point set

- fixed
This commit is contained in:
James 2012-11-22 14:37:57 -05:00
parent 612ac415d2
commit 87d0383533
2 changed files with 16 additions and 12 deletions

View file

@ -48,7 +48,7 @@ class Application_Common_DateHelper
/** /**
* Get the week start date of this week in the format * Get the week start date of this week in the format
* YYYY-MM-DD * YYYY-MM-DD
* *
* @return String - week start date * @return String - week start date
*/ */
function getWeekStartDate() function getWeekStartDate()
@ -231,7 +231,7 @@ class Application_Common_DateHelper
if (2 !== substr_count($p_time, ":")){ if (2 !== substr_count($p_time, ":")){
return FALSE; return FALSE;
} }
if (1 === substr_count($p_time, ".")){ if (1 === substr_count($p_time, ".")){
list($hhmmss, $ms) = explode(".", $p_time); list($hhmmss, $ms) = explode(".", $p_time);
} else { } else {
@ -275,17 +275,17 @@ class Application_Common_DateHelper
return $dateTime; return $dateTime;
} }
/* Convenience method to return a date formatted into a String rather than a /* Convenience method to return a date formatted into a String rather than a
* DateTime object. Note that if an empty string is provided for $p_dateString * DateTime object. Note that if an empty string is provided for $p_dateString
* then the current time is provided. * then the current time is provided.
* *
* @param $p_dateString * @param $p_dateString
* Date string in UTC timezone. * Date string in UTC timezone.
* @param $p_format * @param $p_format
* Format which the string should be returned in. * Format which the string should be returned in.
* *
* @return string * @return string
* Date String in localtime * Date String in localtime
* */ * */
public static function ConvertToLocalDateTimeString($p_dateString, $p_format="Y-m-d H:i:s"){ public static function ConvertToLocalDateTimeString($p_dateString, $p_format="Y-m-d H:i:s"){
if (is_null($p_dateString) || strlen($p_dateString) == 0) if (is_null($p_dateString) || strlen($p_dateString) == 0)
@ -302,7 +302,7 @@ class Application_Common_DateHelper
/* /*
* Example input: "00:02:32.746562". Output is a DateInterval object * Example input: "00:02:32.746562". Output is a DateInterval object
* representing that 2 minute, 32.746562 second interval. * representing that 2 minute, 32.746562 second interval.
* *
*/ */
public static function getDateIntervalFromString($p_interval){ public static function getDateIntervalFromString($p_interval){
list($hour_min_sec, $subsec) = explode(".", $p_interval); list($hour_min_sec, $subsec) = explode(".", $p_interval);
@ -335,7 +335,7 @@ class Application_Common_DateHelper
$retVal['errMsg'] = "The year '$year' must be within the range of 1753 - 9999"; $retVal['errMsg'] = "The year '$year' must be within the range of 1753 - 9999";
} else if (!checkdate($month, $day, $year)) { } else if (!checkdate($month, $day, $year)) {
$retVal['success'] = false; $retVal['success'] = false;
$retVal['errMsg'] = "'$year-$month-$day' is not a valid date"; $retVal['errMsg'] = "'$year-$month-$day' is not a valid date";
} else { } else {
// check time // check time
if (isset($timeInfo)) { if (isset($timeInfo)) {

View file

@ -266,8 +266,12 @@ class Application_Model_ShowBuilder
$row["instance"] = intval($p_item["si_id"]); $row["instance"] = intval($p_item["si_id"]);
$row["starts"] = $schedStartDT->format("H:i:s"); $row["starts"] = $schedStartDT->format("H:i:s");
$row["ends"] = $schedEndDT->format("H:i:s"); $row["ends"] = $schedEndDT->format("H:i:s");
$formatter = new LengthFormatter($p_item['file_length']); $cue_out = Application_Common_DateHelper::calculateLengthInSeconds($p_item['cue_out']);
$cue_in = Application_Common_DateHelper::calculateLengthInSeconds($p_item['cue_in']);
$run_time = $cue_out-$cue_in;
$formatter = new LengthFormatter(Application_Common_DateHelper::ConvertMSToHHMMSSmm($run_time*1000));
$row['runtime'] = $formatter->format(); $row['runtime'] = $formatter->format();
$row["title"] = $p_item["file_track_title"]; $row["title"] = $p_item["file_track_title"];