From 69054806c475f2b64bb26832070cfc1e7c675ce4 Mon Sep 17 00:00:00 2001 From: denise Date: Mon, 11 Feb 2013 12:24:06 -0500 Subject: [PATCH] CC-4940: Playlist editor in Library ignores cue points set by silence detection when displaying item time - fixed by setting length to cue_out - cue_in when tracks get added to playlist/block --- airtime_mvc/application/models/Block.php | 5 ++++- airtime_mvc/application/models/Playlist.php | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php index ffe15ac56..aed47c3a1 100644 --- a/airtime_mvc/application/models/Block.php +++ b/airtime_mvc/application/models/Block.php @@ -403,10 +403,13 @@ SQL; $entry = $this->blockItem; $entry["id"] = $file->getDbId(); $entry["pos"] = $pos; - $entry["cliplength"] = $file->getDbLength(); $entry["cueout"] = $file->getDbCueout(); $entry["cuein"] = $file->getDbCuein(); + $cue_out = Application_Common_DateHelper::calculateLengthInSeconds($entry['cueout']); + $cue_in = Application_Common_DateHelper::calculateLengthInSeconds($entry['cuein']); + $entry["cliplength"] = $cue_out-$cue_in; + return $entry; } else { throw new Exception("trying to add a file that does not exist."); diff --git a/airtime_mvc/application/models/Playlist.php b/airtime_mvc/application/models/Playlist.php index 3230a7fa1..9fae286ac 100644 --- a/airtime_mvc/application/models/Playlist.php +++ b/airtime_mvc/application/models/Playlist.php @@ -398,14 +398,18 @@ SQL; $entry = $this->plItem; $entry["id"] = $obj->getDbId(); $entry["pos"] = $pos; - $entry["cliplength"] = $obj->getDbLength(); if ($obj instanceof CcFiles && $obj) { $entry["cuein"] = $obj->getDbCuein(); $entry["cueout"] = $obj->getDbCueout(); + + $cue_out = Application_Common_DateHelper::calculateLengthInSeconds($entry['cueout']); + $cue_in = Application_Common_DateHelper::calculateLengthInSeconds($entry['cuein']); + $entry["cliplength"] = $cue_out-$cue_in; } elseif ($obj instanceof CcWebstream && $obj) { $entry["cuein"] = "00:00:00"; $entry["cueout"] = $entry["cliplength"]; } + $entry["cliplength"] = $obj->getDbLength(); $entry["ftype"] = $objType; }