From 4a4ef2767e90ba9040a0d2080b901e6667170927 Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Sun, 1 Sep 2013 17:59:47 -0400 Subject: [PATCH] CC-5318 : Playout History: The last song of the show will display wrong end time. --- airtime_mvc/application/services/HistoryService.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/services/HistoryService.php b/airtime_mvc/application/services/HistoryService.php index 08649097f..10e559c3b 100644 --- a/airtime_mvc/application/services/HistoryService.php +++ b/airtime_mvc/application/services/HistoryService.php @@ -526,10 +526,14 @@ class Application_Service_HistoryService $metadata = array(); $metadata["showname"] = $show->getDbName(); + $instanceEnd = $showInstance->getDbEnds(null); + $itemEnd = $item->getDbEnds(null); + $recordEnd = ($instanceEnd < $itemEnd) ? $instanceEnd : $itemEnd; + $history = new CcPlayoutHistory(); $history->setDbFileId($fileId); $history->setDbStarts($item->getDbStarts(null)); - $history->setDbEnds($item->getDbEnds(null)); + $history->setDbEnds($recordEnd); $history->setDbInstanceId($item->getDbInstanceId()); foreach ($metadata as $key => $val) {