From 5743a0f5824c7f0a2d401cfec31df2b706316db1 Mon Sep 17 00:00:00 2001 From: dakriy Date: Wed, 19 Mar 2025 04:13:30 -0700 Subject: [PATCH] fix(legacy): scheduled show length should not add track fade times (#3144) ### Description When generating a show that contains a playlist with dynamic blocks, the show will be incorrectly under scheduled because the fade time was added onto the total track length. Fade should not add time to an overall track length as then it wouldn't be a fade. **This is a new feature**: No **I have updated the documentation to reflect these changes**: No, none needed. ### Testing Notes **What I did:** I created a playlist with 3 dynamic blocks: 1. 10 minute length dynamic block 2. 1 item dynamic block 3. fill rest of show dynamic block I then created a show with the defined auto loading playlist. I then saw that on auto-load the show was not under scheduled. **How you can replicate my testing:** See testing notes Co-authored-by: Kyle Robbertze --- legacy/application/models/Scheduler.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/legacy/application/models/Scheduler.php b/legacy/application/models/Scheduler.php index b9109665b..a4de230e6 100644 --- a/legacy/application/models/Scheduler.php +++ b/legacy/application/models/Scheduler.php @@ -1346,14 +1346,11 @@ final class Application_Model_Scheduler // This is used to determine the duration of a files array public function timeLengthOfFiles($files) { - $timeLength = 0; - foreach ($files as $file) { - $timeLength += Application_Common_DateHelper::playlistTimeToSeconds($file['cliplength']); - $timeLength += $file['fadein']; - $timeLength += $file['fadeout']; - } - - return $timeLength; + return array_reduce( + $files, + fn ($acc, $file) => $acc + Application_Common_DateHelper::playlistTimeToSeconds($file['cliplength']), + 0.0 + ); } /*