CC-4882: Scheduled item does not take into account cue_out - cue_in time

-fixed
This commit is contained in:
denise 2013-01-28 14:21:11 -05:00
parent 2ef8604c31
commit f1215c10fd
2 changed files with 13 additions and 2 deletions

View File

@ -136,13 +136,17 @@ class Application_Model_Scheduler
if ($type === "audioclip") {
$file = CcFilesQuery::create()->findPK($id, $this->con);
$storedFile = new Application_Model_StoredFile($file->getDbId());
if (is_null($file) || !$file->visible()) {
throw new Exception(_("A selected File does not exist!"));
} else {
$data = $this->fileInfo;
$data["id"] = $id;
$data["cliplength"] = $file->getDbLength();
$data["cliplength"] = $storedFile->getRealClipLength(
$file->getDbCuein(),
$file->getDbCueout());
$data["cuein"] = $file->getDbCuein();
$data["cueout"] = $file->getDbCueout();
@ -438,7 +442,6 @@ class Application_Model_Scheduler
}
foreach ($schedFiles as $file) {
$endTimeDT = $this->findEndTime($nextStartDT, $file['cliplength']);
//item existed previously and is being moved.

View File

@ -1285,6 +1285,14 @@ SQL;
}
}
}
public 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 {}