Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
denise 2013-01-10 12:04:44 -05:00
commit c20ed7ebad
2 changed files with 7 additions and 5 deletions

View File

@ -270,11 +270,7 @@ class Application_Model_ShowBuilder
$cue_out = Application_Common_DateHelper::calculateLengthInSeconds($p_item['cue_out']);
$cue_in = Application_Common_DateHelper::calculateLengthInSeconds($p_item['cue_in']);
if ($cue_out == 0 && $cue_in == 0) {
$run_time = Application_Common_DateHelper::calculateLengthInSeconds($p_item['file_length']);
} else {
$run_time = $cue_out-$cue_in;
}
$run_time = $cue_out-$cue_in;
$formatter = new LengthFormatter(Application_Common_DateHelper::ConvertMSToHHMMSSmm($run_time*1000));
$row['runtime'] = $formatter->format();

View File

@ -129,9 +129,15 @@ class Application_Model_StoredFile
# Translate metadata attributes from media monitor (MDATA_KEY_*)
# to their counterparts in constants.php (usually the column names)
$track_length = $p_md['MDATA_KEY_DURATION'];
$track_length_in_sec = Application_Common_DateHelper::calculateLengthInSeconds($track_length);
foreach ($p_md as $mdConst => $mdValue) {
if (defined($mdConst)) {
if ($mdConst == "MDATA_KEY_CUE_OUT" && $mdValue == '0.0') {
$mdValue = $track_length_in_sec;
}
$dbMd[constant($mdConst)] = $mdValue;
} else {
Logging::warn("using metadata that is not defined.
[$mdConst] => [$mdValue]");