diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index f46bfedde..f4acdf886 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -674,6 +674,12 @@ SQL; $start = self::AirtimeTimeToPypoTime($item["start"]); $end = self::AirtimeTimeToPypoTime($item["end"]); + list(,,,$start_hour,,) = explode("-", $start); + list(,,,$end_hour,,) = explode("-", $end); + + $same_hour = $start_hour == $end_hour; + $independent_event = !$same_hour; + $schedule_item = array( 'id' => $media_id, 'type' => 'file', @@ -687,7 +693,7 @@ SQL; 'end' => $end, 'show_name' => $item["show_name"], 'replay_gain' => is_null($item["replay_gain"]) ? "0": $item["replay_gain"], - 'independent_event' => false + 'independent_event' => $independent_event, ); self::appendScheduleItem($data, $start, $schedule_item); } @@ -859,6 +865,8 @@ SQL; $data = array(); $data["media"] = array(); + //Harbor kick times *MUST* be ahead of schedule events, so that pypo + //executes them first. self::createInputHarborKickTimes($data, $range_start, $range_end); self::createScheduledEvents($data, $range_start, $range_end);