From d6c8e8ca3ddafa1ec2f4a6e22b455a7ecbe0d12b Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 28 Mar 2011 18:07:16 -0400 Subject: [PATCH] CC-2092: When listening to a rebroadcast show, UI is telling me show is empty -Fixed --- application/models/Schedule.php | 25 +++++++++++++++++++++++++ application/models/Shows.php | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/application/models/Schedule.php b/application/models/Schedule.php index d1d556e1f..d2cb8e801 100644 --- a/application/models/Schedule.php +++ b/application/models/Schedule.php @@ -466,6 +466,30 @@ class Schedule { { global $CC_CONFIG, $CC_DBC; + $sql = "SELECT DISTINCT" + ." pt.name," + ." ft.track_title," + ." ft.artist_name," + ." ft.album_title," + ." st.starts," + ." st.ends," + ." st.clip_length," + ." st.media_item_played," + ." st.group_id," + ." show.name as show_name," + ." st.instance_id" + ." FROM $CC_CONFIG[scheduleTable] st" + ." LEFT JOIN $CC_CONFIG[filesTable] ft" + ." ON st.file_id = ft.id" + ." LEFT JOIN $CC_CONFIG[playListTable] pt" + ." ON st.playlist_id = pt.id" + ." LEFT JOIN $CC_CONFIG[showInstances] si" + ." ON st.instance_id = si.id" + ." LEFT JOIN $CC_CONFIG[showTable] show" + ." ON si.show_id = show.id" + ." WHERE st.starts < si.ends"; + +/* $sql = "SELECT DISTINCT pt.name, ft.track_title, ft.artist_name, ft.album_title, st.starts, st.ends, st.clip_length, st.media_item_played, st.group_id, show.name as show_name, st.instance_id" ." FROM $CC_CONFIG[scheduleTable] st, $CC_CONFIG[filesTable] ft, $CC_CONFIG[playListTable] pt, $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] show" ." WHERE st.playlist_id = pt.id" @@ -473,6 +497,7 @@ class Schedule { ." AND st.instance_id = si.id" ." AND si.show_id = show.id" ." AND st.starts < si.ends"; +*/ if ($timePeriod < 0){ $sql .= " AND st.ends < TIMESTAMP '$timeStamp'" diff --git a/application/models/Shows.php b/application/models/Shows.php index 2ba843697..71273c00d 100644 --- a/application/models/Shows.php +++ b/application/models/Shows.php @@ -930,7 +930,7 @@ class Show_DAL { ." OR (si.starts < TIMESTAMP '$timeNow' + INTERVAL '$end seconds' AND si.ends > TIMESTAMP '$timeNow' + INTERVAL '$end seconds'))" //checking for st.starts IS NULL so that the query also returns shows that do not have any items scheduled. ." AND (st.starts < si.ends OR st.starts IS NULL)" - ." ORDER BY st.starts"; + ." ORDER BY si.starts, st.starts"; return $CC_DBC->GetAll($sql); }