From 9638f6dd3ee35b97e2d134ffb7222ba32d047575 Mon Sep 17 00:00:00 2001 From: mkonecny Date: Thu, 5 May 2011 16:45:13 -0400 Subject: [PATCH] cc-2167: now playing view with recording shows a gap -implemented --- .../controllers/DashboardController.php | 27 ------------------- airtime_mvc/application/models/Nowplaying.php | 8 +++++- airtime_mvc/application/models/Schedule.php | 10 ------- .../airtime/nowplaying/nowplayingdatagrid.js | 12 +++++++++ airtime_mvc/public/js/playlist/playlist.js | 6 ++++- 5 files changed, 24 insertions(+), 39 deletions(-) delete mode 100644 airtime_mvc/application/controllers/DashboardController.php diff --git a/airtime_mvc/application/controllers/DashboardController.php b/airtime_mvc/application/controllers/DashboardController.php deleted file mode 100644 index 811800ca3..000000000 --- a/airtime_mvc/application/controllers/DashboardController.php +++ /dev/null @@ -1,27 +0,0 @@ -getName(), "", "", "", "", "", "", "", "", ""); + } public static function GetDataGridData($viewType, $dateString){ @@ -73,7 +77,9 @@ class Application_Model_Nowplaying //append show gap time row $gapTime = $si->getShowEndGapTime(); - if ($gapTime > 0) + if ($si->isRecorded()) + $data[] = Application_Model_Nowplaying::CreateRecordingRow($si); + else if ($gapTime > 0) $data[] = Application_Model_Nowplaying::CreateGapRow($gapTime); } diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index bce835269..d83056522 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -424,16 +424,6 @@ class Schedule { ." 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" - ." AND st.file_id = ft.id" - ." 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'" ." AND st.ends > (TIMESTAMP '$timeStamp' - INTERVAL '$interval')" diff --git a/airtime_mvc/public/js/airtime/nowplaying/nowplayingdatagrid.js b/airtime_mvc/public/js/airtime/nowplaying/nowplayingdatagrid.js index 005dcb45b..737fdbb8c 100644 --- a/airtime_mvc/public/js/airtime/nowplaying/nowplayingdatagrid.js +++ b/airtime_mvc/public/js/airtime/nowplaying/nowplayingdatagrid.js @@ -178,6 +178,18 @@ function createDataGrid(){ nCell.innerHTML = "Gap until show end: " + gapTime + " seconds"; nGroup.appendChild(nCell); nTrs[i].parentNode.replaceChild(nGroup, nTrs[i]); + } else if ( sType.indexOf("r") != -1 ){ + //gap row found + + var showName = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex]]._aData[1]; + + var nGroup = document.createElement('tr'); + var nCell = document.createElement('td'); + nCell.colSpan = iColspan; + nCell.className = "record"; + nCell.innerHTML = "Recording show \"" + showName + "\""; + nGroup.appendChild(nCell); + nTrs[i].parentNode.replaceChild(nGroup, nTrs[i]); } } diff --git a/airtime_mvc/public/js/playlist/playlist.js b/airtime_mvc/public/js/playlist/playlist.js index 6dc3faa85..c6c37c213 100644 --- a/airtime_mvc/public/js/playlist/playlist.js +++ b/airtime_mvc/public/js/playlist/playlist.js @@ -139,7 +139,11 @@ function updatePlaybar(){ } if (currentSong.length > 0){ $('#current').text(getTrackInfo(currentSong[0])); - } + } else if (currentShow.length > 0){ + if (currentShow[0].record == "1"){ + $('#current').html("Current: Recording"); + } + } if (nextSongs.length > 0){ $('#next').text(getTrackInfo(nextSongs[0])); $('#next-length').text(convertToHHMMSSmm(nextSongs[0].songLengthMs));