CC-3618: Current playing Text Field in Dashboard alternates between "Nothing

Scheduled" and "current playing song"

- fixed
This commit is contained in:
James 2012-04-11 15:54:03 -04:00
parent c510286614
commit 8f197115ae
2 changed files with 11 additions and 5 deletions

View File

@ -114,6 +114,9 @@ class Application_Model_Schedule {
$timeNowAsMillis = strtotime($p_timeNow);
for( $i = 0; $i < $numberOfRows; ++$i ){
if($rows[$i]['ends'] > $rows[$i]["show_ends"]){
$rows[$i]['ends'] = $rows[$i]["show_ends"];
}
if ((strtotime($rows[$i]['starts']) <= $timeNowAsMillis) && (strtotime($rows[$i]['ends']) >= $timeNowAsMillis)){
if ( $i - 1 >= 0){
$results['previous'] = array("name"=>$rows[$i-1]["artist_name"]." - ".$rows[$i-1]["track_title"],

View File

@ -135,25 +135,28 @@ function updateProgressBarValue(){
function updatePlaybar(){
/* Column 0 update */
$('#previous').empty();
$('#prev-length').empty();
$('#current').html("Current: <span style='color:red; font-weight:bold'>Nothing Scheduled</span>");
$('#next').empty();
$('#next-length').empty();
if (previousSong !== null){
$('#previous').text(previousSong.name+",");
$('#prev-length').text(convertToHHMMSSmm(previousSong.songLengthMs));
}else{
$('#previous').empty();
$('#prev-length').empty();
}
if (currentSong !== null){
if (currentSong.record == "1")
$('#current').html("<span style='color:red; font-weight:bold'>Recording: </span>"+currentSong.name+",");
else
$('#current').text(currentSong.name+",");
}else{
$('#current').html("Current: <span style='color:red; font-weight:bold'>Nothing Scheduled</span>");
}
if (nextSong !== null){
$('#next').text(nextSong.name+",");
$('#next-length').text(convertToHHMMSSmm(nextSong.songLengthMs));
}else{
$('#next').empty();
$('#next-length').empty();
}
$('#start').empty();