CC-3367: Display in Now Playing whether Live DJ stream and Live Master stream

are connected and give user the ability to block those streams

- added stream source switch interface
- backend code
This commit is contained in:
James 2012-03-08 17:42:38 -05:00
parent d4a387e113
commit f193047a1c
19 changed files with 383 additions and 38 deletions

View file

@ -29,6 +29,7 @@ class ApiController extends Zend_Controller_Action
->addActionContext('handle-watched-dir-missing', 'json')
->addActionContext('rabbitmq-do-push', 'json')
->addActionContext('check-live-stream-auth', 'json')
->addActionContext('update-source-status', 'json')
->initContext();
}
@ -862,6 +863,16 @@ class ApiController extends Zend_Controller_Action
Application_Model_StreamSetting::setLiquidsoapError($stream_id, $msg, $boot_time);
}
public function updateSourceStatusAction(){
$request = $this->getRequest();
$msg = $request->getParam('msg');
$sourcename = $request->getParam('sourcename');
$status = $request->getParam('status');
Application_Model_Preference::SetSourceStatus($sourcename, $status);
}
// handles addition/deletion of mount point which watched dirs reside
public function updateFileSystemMountAction(){

View file

@ -5,14 +5,42 @@ class DashboardController extends Zend_Controller_Action
public function init()
{
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('switch-source', 'json')
->initContext();
}
public function indexAction()
{
// action body
}
public function switchSourceAction(){
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$sourcename = $this->_getParam('sourcename');
$current_status = $this->_getParam('status');
$change_status_to = "on";
if(strtolower($current_status) == "on"){
$change_status_to = "off";
}
$data = array("sourcename"=>$sourcename, "status"=>$change_status_to);
Application_Model_RabbitMq::SendMessageToPypo("switch_source", $data);
if(strtolower($current_status) == "on"){
Application_Model_Preference::SetSourceSwitchStatus($sourcename, "off");
$this->view->status = "OFF";
}else{
Application_Model_Preference::SetSourceSwitchStatus($sourcename, "on");
$this->view->status = "ON";
}
}
public function switchOffSource(){
}
public function streamPlayerAction()
{
global $CC_CONFIG;

View file

@ -321,8 +321,18 @@ class ScheduleController extends Zend_Controller_Action
Application_Model_Show::ConvertToLocalTimeZone($range["currentShow"], array("starts", "ends", "start_timestamp", "end_timestamp"));
Application_Model_Show::ConvertToLocalTimeZone($range["nextShow"], array("starts", "ends", "start_timestamp", "end_timestamp"));
$source_status = array();
$live_dj = Application_Model_Preference::GetSourceStatus("live_dj");
$master_dj = Application_Model_Preference::GetSourceStatus("master_dj");
//might not be the correct place to implement this but for now let's just do it here
$source_status['live_dj_source'] = $live_dj;
$source_status['master_dj_source'] = $master_dj;
$this->view->source_status = $source_status;
$this->view->entries = $range;
}
public function removeGroupAction()