-fixed bug where a song would appear as current song and next song simultaneously.

-show background color switching on the list-view should now be instant.
This commit is contained in:
martin 2011-02-13 15:35:41 -05:00
parent bb82dc2f4a
commit 416c6ceb10
5 changed files with 29 additions and 40 deletions

View file

@ -75,23 +75,27 @@ class Application_Model_Nowplaying
foreach ($previous as $item){
array_push($rows, array("p", $item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"],
$item["album_title"], $item["name"], $item["show_name"], $item["current_show"], $item["group_id"]));
$item["album_title"], $item["name"], $item["show_name"], $item["instance_id"], $item["group_id"]));
}
foreach ($current as $item){
array_push($rows, array("c", $item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"],
$item["album_title"], $item["name"], $item["show_name"], $item["current_show"], $item["group_id"]));
$item["album_title"], $item["name"], $item["show_name"], $item["instance_id"], $item["group_id"]));
}
foreach ($next as $item){
array_push($rows, array("n", $item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"],
$item["album_title"], $item["name"], $item["show_name"], $item["current_show"], $item["group_id"]));
$item["album_title"], $item["name"], $item["show_name"], $item["instance_id"], $item["group_id"]));
}
$rows = Application_Model_Nowplaying::FindGaps($rows);
$data = array("rows"=>$rows);
$date = new Application_Model_DateHelper;
$timeNow = $date->getDate();
$data = array("currentShow"=>Show_DAL::GetCurrentShow($timeNow), "rows"=>$rows);
return $data;
}
}

View file

@ -469,11 +469,8 @@ class Schedule {
*/
public static function Get_Scheduled_Item_Data($timeStamp, $timePeriod=0, $count = 0, $interval="0 hours"){
global $CC_CONFIG, $CC_DBC;
$date = new Application_Model_DateHelper;
$timeNow = $date->getDate();
$sql = "SELECT DISTINCT pt.name, ft.track_title, ft.artist_name, ft.album_title, st.starts, st.ends, st.clip_length, st.group_id, show.name as show_name, (si.starts <= TIMESTAMP '$timeNow' AND si.ends > TIMESTAMP '$timeNow') as current_show"
$sql = "SELECT DISTINCT pt.name, ft.track_title, ft.artist_name, ft.album_title, st.starts, st.ends, st.clip_length, 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"
." AND st.file_id = ft.id"
@ -487,9 +484,9 @@ class Schedule {
." LIMIT $count";
} else if ($timePeriod == 0){
$sql .= " AND st.starts <= TIMESTAMP '$timeStamp'"
." AND st.ends > TIMESTAMP '$timeStamp'";
." AND st.ends >= TIMESTAMP '$timeStamp'";
} else if ($timePeriod > 0){
$sql .= " AND st.starts >= TIMESTAMP '$timeStamp'"
$sql .= " AND st.starts > TIMESTAMP '$timeStamp'"
." AND st.starts < (TIMESTAMP '$timeStamp' + INTERVAL '$interval')"
." ORDER BY st.starts"
." LIMIT $count";

View file

@ -733,7 +733,7 @@ class Show_DAL{
$date = $timestamp[0];
$time = $timestamp[1];
$sql = "SELECT si.starts as start_timestamp, si.ends as end_timestamp, s.name, s.id"
$sql = "SELECT si.starts as start_timestamp, si.ends as end_timestamp, s.name, s.id, si.id as instance_id"
." FROM $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] s"
." WHERE si.show_id = s.id"
." AND si.starts <= TIMESTAMP '$timeNow'"