From 479e112317c494806ce8c425aed88700a3186ca0 Mon Sep 17 00:00:00 2001
From: denise <denise@denise-DX4860.(none)>
Date: Mon, 16 Apr 2012 15:51:05 -0400
Subject: [PATCH] CC-3637: Now playing shows "Nothing Scheduled" when
 restreaming external source

-fixed
---
 .../application/controllers/ScheduleController.php    |  2 ++
 airtime_mvc/public/js/airtime/dashboard/playlist.js   | 11 +++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php
index 9becb88f8..0268b77e1 100644
--- a/airtime_mvc/application/controllers/ScheduleController.php
+++ b/airtime_mvc/application/controllers/ScheduleController.php
@@ -333,6 +333,7 @@ class ScheduleController extends Zend_Controller_Action
     public function getCurrentPlaylistAction()
     {
         $range = Application_Model_Schedule::GetPlayOrderRange();
+        $show = Application_Model_Show::GetCurrentShow();
 
         /* Convert all UTC times to localtime before sending back to user. */
         if (isset($range["previous"])){
@@ -371,6 +372,7 @@ class ScheduleController extends Zend_Controller_Action
         $this->view->switch_status = $switch_status;
         
         $this->view->entries = $range;
+        $this->view->show_name = $show[0]["name"];
     }
 
     public function removeGroupAction()
diff --git a/airtime_mvc/public/js/airtime/dashboard/playlist.js b/airtime_mvc/public/js/airtime/dashboard/playlist.js
index 34bd81eb0..d48734fc3 100644
--- a/airtime_mvc/public/js/airtime/dashboard/playlist.js
+++ b/airtime_mvc/public/js/airtime/dashboard/playlist.js
@@ -8,6 +8,8 @@ var nextSong = null;
 var currentShow = new Array();
 var nextShow = new Array();
 
+var showName = null;
+
 var currentElem;
 
 var serverUpdateInterval = 5000;
@@ -149,9 +151,13 @@ function updatePlaybar(){
             $('#current').text(currentSong.name+",");
     }else{
         if (master_dj_on_air) {
-            $('#current').html("Current: <span style='color:red; font-weight:bold'>Master Stream</span>");
+            if (showName) {
+                $('#current').html("Current: <span style='color:red; font-weight:bold'>"+showName+" - Master Stream</span>");
+            } else {
+                $('#current').html("Current: <span style='color:red; font-weight:bold'>Master Stream</span>");
+            }
         } else if (live_dj_on_air) {
-            $('#current').html("Current: <span style='color:red; font-weight:bold'>"+currentShow.name+"</span>");
+            $('#current').html("Current: <span style='color:red; font-weight:bold'>"+showName+" - Live Stream</span>");
         } else {
             $('#current').html("Current: <span style='color:red; font-weight:bold'>Nothing Scheduled</span>");
         }
@@ -352,6 +358,7 @@ function getScheduleFromServer(){
                 parseItems(data.entries);
                 parseSourceStatus(data.source_status);
                 parseSwitchStatus(data.switch_status);
+                showName = data.show_name;
           }, error:function(jqXHR, textStatus, errorThrown){}});
     setTimeout(getScheduleFromServer, serverUpdateInterval);
 }