CC-3618: Current playing Text Field in Dashboard alternates between "Nothing
Scheduled" and "current playing song" - fixed
This commit is contained in:
parent
c510286614
commit
8f197115ae
2 changed files with 11 additions and 5 deletions
|
@ -114,6 +114,9 @@ class Application_Model_Schedule {
|
||||||
|
|
||||||
$timeNowAsMillis = strtotime($p_timeNow);
|
$timeNowAsMillis = strtotime($p_timeNow);
|
||||||
for( $i = 0; $i < $numberOfRows; ++$i ){
|
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 ((strtotime($rows[$i]['starts']) <= $timeNowAsMillis) && (strtotime($rows[$i]['ends']) >= $timeNowAsMillis)){
|
||||||
if ( $i - 1 >= 0){
|
if ( $i - 1 >= 0){
|
||||||
$results['previous'] = array("name"=>$rows[$i-1]["artist_name"]." - ".$rows[$i-1]["track_title"],
|
$results['previous'] = array("name"=>$rows[$i-1]["artist_name"]." - ".$rows[$i-1]["track_title"],
|
||||||
|
|
|
@ -135,25 +135,28 @@ function updateProgressBarValue(){
|
||||||
|
|
||||||
function updatePlaybar(){
|
function updatePlaybar(){
|
||||||
/* Column 0 update */
|
/* 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){
|
if (previousSong !== null){
|
||||||
$('#previous').text(previousSong.name+",");
|
$('#previous').text(previousSong.name+",");
|
||||||
$('#prev-length').text(convertToHHMMSSmm(previousSong.songLengthMs));
|
$('#prev-length').text(convertToHHMMSSmm(previousSong.songLengthMs));
|
||||||
|
}else{
|
||||||
|
$('#previous').empty();
|
||||||
|
$('#prev-length').empty();
|
||||||
}
|
}
|
||||||
if (currentSong !== null){
|
if (currentSong !== null){
|
||||||
if (currentSong.record == "1")
|
if (currentSong.record == "1")
|
||||||
$('#current').html("<span style='color:red; font-weight:bold'>Recording: </span>"+currentSong.name+",");
|
$('#current').html("<span style='color:red; font-weight:bold'>Recording: </span>"+currentSong.name+",");
|
||||||
else
|
else
|
||||||
$('#current').text(currentSong.name+",");
|
$('#current').text(currentSong.name+",");
|
||||||
|
}else{
|
||||||
|
$('#current').html("Current: <span style='color:red; font-weight:bold'>Nothing Scheduled</span>");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextSong !== null){
|
if (nextSong !== null){
|
||||||
$('#next').text(nextSong.name+",");
|
$('#next').text(nextSong.name+",");
|
||||||
$('#next-length').text(convertToHHMMSSmm(nextSong.songLengthMs));
|
$('#next-length').text(convertToHHMMSSmm(nextSong.songLengthMs));
|
||||||
|
}else{
|
||||||
|
$('#next').empty();
|
||||||
|
$('#next-length').empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#start').empty();
|
$('#start').empty();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue