From 5330859f004de8f5d00ae7e098c87c7c3b602da7 Mon Sep 17 00:00:00 2001 From: drigato Date: Fri, 22 May 2015 08:51:32 -0400 Subject: [PATCH] SAAS-794: Schedule/get-current-playlist can take too long to respond small fix --- airtime_mvc/application/models/Schedule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index f33586fc8..22a26f7af 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -153,7 +153,7 @@ SQL; $sql = "select s.id, s.starts, s.ends, s.file_id, s.stream_id, s.media_item_played, s.instance_id, si.ends as show_ends from cc_schedule s left join cc_show_instances si on s.instance_id = si.id where s.playout_status > 0 and s.starts <= :p1 - and s.ends >= :p2 order by starts limit 1"; + and s.ends >= :p2 order by starts desc limit 1"; $params = array( ":p1" => $utcNow->format("Y-m-d H:i:s"),