diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php
index 943d3da54..8394fb13c 100644
--- a/airtime_mvc/application/models/Schedule.php
+++ b/airtime_mvc/application/models/Schedule.php
@@ -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"],
diff --git a/airtime_mvc/public/js/airtime/dashboard/playlist.js b/airtime_mvc/public/js/airtime/dashboard/playlist.js
index 9bbed3603..3ad590fb6 100644
--- a/airtime_mvc/public/js/airtime/dashboard/playlist.js
+++ b/airtime_mvc/public/js/airtime/dashboard/playlist.js
@@ -135,25 +135,28 @@ function updateProgressBarValue(){
function updatePlaybar(){
/* Column 0 update */
- $('#previous').empty();
- $('#prev-length').empty();
- $('#current').html("Current: Nothing Scheduled");
- $('#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("Recording: "+currentSong.name+",");
else
$('#current').text(currentSong.name+",");
+ }else{
+ $('#current').html("Current: Nothing Scheduled");
}
if (nextSong !== null){
$('#next').text(nextSong.name+",");
$('#next-length').text(convertToHHMMSSmm(nextSong.songLengthMs));
+ }else{
+ $('#next').empty();
+ $('#next-length').empty();
}
$('#start').empty();