CC-5251 : Playlist length is not shown in Library
This commit is contained in:
parent
bec56e5f4b
commit
a680421281
|
@ -200,9 +200,12 @@ class Application_Model_Scheduler
|
||||||
} else {
|
} else {
|
||||||
$data = $this->fileInfo;
|
$data = $this->fileInfo;
|
||||||
$data["id"] = $id;
|
$data["id"] = $id;
|
||||||
$data["cliplength"] = Application_Model_StoredFile::getRealClipLength(
|
|
||||||
$file->getDbCuein(),
|
$cuein = Application_Common_DateHelper::playlistTimeToSeconds($file->getDbCuein());
|
||||||
$file->getDbCueout());
|
$cueout = Application_Common_DateHelper::playlistTimeToSeconds($file->getDbCueout());
|
||||||
|
$row_length = Application_Common_DateHelper::secondsToPlaylistTime($cueout - $cuein);
|
||||||
|
|
||||||
|
$data["cliplength"] = $row_length;
|
||||||
|
|
||||||
$data["cuein"] = $file->getDbCuein();
|
$data["cuein"] = $file->getDbCuein();
|
||||||
$data["cueout"] = $file->getDbCueout();
|
$data["cueout"] = $file->getDbCueout();
|
||||||
|
|
|
@ -778,9 +778,7 @@ SQL;
|
||||||
foreach ($results['aaData'] as &$row) {
|
foreach ($results['aaData'] as &$row) {
|
||||||
$row['id'] = intval($row['id']);
|
$row['id'] = intval($row['id']);
|
||||||
|
|
||||||
$len_formatter = new LengthFormatter(
|
if ($row['ftype'] === "audioclip") {
|
||||||
self::getRealClipLength($row["cuein"], $row["cueout"]));
|
|
||||||
$row['length'] = $len_formatter->format();
|
|
||||||
|
|
||||||
$cuein_formatter = new LengthFormatter($row["cuein"]);
|
$cuein_formatter = new LengthFormatter($row["cuein"]);
|
||||||
$row["cuein"] = $cuein_formatter->format();
|
$row["cuein"] = $cuein_formatter->format();
|
||||||
|
@ -788,7 +786,10 @@ SQL;
|
||||||
$cueout_formatter = new LengthFormatter($row["cueout"]);
|
$cueout_formatter = new LengthFormatter($row["cueout"]);
|
||||||
$row["cueout"] = $cueout_formatter->format();
|
$row["cueout"] = $cueout_formatter->format();
|
||||||
|
|
||||||
if ($row['ftype'] === "audioclip") {
|
$cuein = Application_Common_DateHelper::playlistTimeToSeconds($row["cuein"]);
|
||||||
|
$cueout = Application_Common_DateHelper::playlistTimeToSeconds($row["cueout"]);
|
||||||
|
$row_length = Application_Common_DateHelper::secondsToPlaylistTime($cueout - $cuein);
|
||||||
|
|
||||||
$formatter = new SamplerateFormatter($row['sample_rate']);
|
$formatter = new SamplerateFormatter($row['sample_rate']);
|
||||||
$row['sample_rate'] = $formatter->format();
|
$row['sample_rate'] = $formatter->format();
|
||||||
|
|
||||||
|
@ -801,9 +802,16 @@ SQL;
|
||||||
|
|
||||||
// for audio preview
|
// for audio preview
|
||||||
$row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION);
|
$row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION);
|
||||||
} else {
|
|
||||||
$row['audioFile'] = $row['id'];
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
$row['audioFile'] = $row['id'];
|
||||||
|
$row_length = $row['length'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$len_formatter = new LengthFormatter($row_length);
|
||||||
|
$row['length'] = $len_formatter->format();
|
||||||
|
|
||||||
//convert mtime and utime to localtime
|
//convert mtime and utime to localtime
|
||||||
$row['mtime'] = new DateTime($row['mtime'], new DateTimeZone('UTC'));
|
$row['mtime'] = new DateTime($row['mtime'], new DateTimeZone('UTC'));
|
||||||
|
@ -1347,14 +1355,6 @@ SQL;
|
||||||
Application_Common_Database::prepareAndExecute($sql, array(),
|
Application_Common_Database::prepareAndExecute($sql, array(),
|
||||||
Application_Common_Database::EXECUTE);
|
Application_Common_Database::EXECUTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getRealClipLength($p_cuein, $p_cueout) {
|
|
||||||
$sql = "SELECT :cueout::INTERVAL - :cuein::INTERVAL";
|
|
||||||
|
|
||||||
return Application_Common_Database::prepareAndExecute($sql, array(
|
|
||||||
':cueout' => $p_cueout,
|
|
||||||
':cuein' => $p_cuein), 'column');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class DeleteScheduledFileException extends Exception {}
|
class DeleteScheduledFileException extends Exception {}
|
||||||
|
|
Loading…
Reference in New Issue