CC-3224: "On-the-fly" stream rebroadcasting
- web interface - auth script for liquidsoap - DB changes
This commit is contained in:
parent
701ed82f40
commit
48bb19d758
26 changed files with 650 additions and 101 deletions
|
@ -28,6 +28,7 @@ class ApiController extends Zend_Controller_Action
|
|||
->addActionContext('update-file-system-mount', 'json')
|
||||
->addActionContext('handle-watched-dir-missing', 'json')
|
||||
->addActionContext('rabbitmq-do-push', 'json')
|
||||
->addActionContext('check-live-stream-auth', 'json')
|
||||
->initContext();
|
||||
}
|
||||
|
||||
|
@ -958,7 +959,6 @@ class ApiController extends Zend_Controller_Action
|
|||
Application_Model_MusicDir::removeWatchedDir($dir, false);
|
||||
}
|
||||
|
||||
|
||||
/* This action is for use by our dev scripts, that make
|
||||
* a change to the database and we want rabbitmq to send
|
||||
* out a message to pypo that a potential change has been made. */
|
||||
|
@ -973,10 +973,31 @@ class ApiController extends Zend_Controller_Action
|
|||
print 'You are not allowed to access this resource.';
|
||||
exit;
|
||||
}
|
||||
|
||||
Logging::log("Notifying RabbitMQ to send message to pypo");
|
||||
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
public function checkLiveStreamAuthAction(){
|
||||
global $CC_CONFIG;
|
||||
|
||||
$request = $this->getRequest();
|
||||
$api_key = $request->getParam('api_key');
|
||||
|
||||
$username = $request->getParam('username');
|
||||
$password = $request->getParam('password');
|
||||
|
||||
if (!in_array($api_key, $CC_CONFIG["apiKey"]))
|
||||
{
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
print 'You are not allowed to access this resource.';
|
||||
exit;
|
||||
}
|
||||
//check against master
|
||||
if($username == Application_Model_Preference::GetLiveSteamMasterUsername() && $password == Application_Model_Preference::GetLiveSteamMasterPassword()){
|
||||
$this->view->msg = true;
|
||||
}else{
|
||||
$this->view->msg = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,11 +47,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
Application_Model_Preference::SetSoundCloudTags($values["preferences_soundcloud"]["SoundCloudTags"]);
|
||||
Application_Model_Preference::SetSoundCloudGenre($values["preferences_soundcloud"]["SoundCloudGenre"]);
|
||||
Application_Model_Preference::SetSoundCloudTrackType($values["preferences_soundcloud"]["SoundCloudTrackType"]);
|
||||
|
||||
Application_Model_Preference::SetLiveSteamAutoEnable($values["preferences_livestream"]["auto_enable_live_stream"]);
|
||||
Application_Model_Preference::SetLiveSteamMasterUsername($values["preferences_livestream"]["master_username"]);
|
||||
Application_Model_Preference::SetLiveSteamMasterPassword($values["preferences_livestream"]["master_password"]);
|
||||
|
||||
Application_Model_Preference::SetSoundCloudLicense($values["preferences_soundcloud"]["SoundCloudLicense"]);
|
||||
|
||||
$this->view->statusMsg = "<div class='success'>Preferences updated.</div>";
|
||||
|
@ -180,6 +175,9 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
$form->setSetting($setting);
|
||||
$form->startFrom();
|
||||
|
||||
$live_stream_subform = new Application_Form_LiveStreamingPreferences();
|
||||
$form->addSubForm($live_stream_subform, "live_stream_subform");
|
||||
|
||||
for($i=1; $i<=$num_of_stream; $i++){
|
||||
$subform = new Application_Form_StreamSettingSubForm();
|
||||
|
@ -194,17 +192,8 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$post_data = $request->getPost();
|
||||
|
||||
$error = false;
|
||||
$values = array();
|
||||
for($i=1; $i<=$num_of_stream; $i++){
|
||||
if(!$form->getSubForm("s".$i."_subform")->isValid($post_data["s".$i."_data"])){
|
||||
$error = true;
|
||||
}else{
|
||||
// getValues returne array of size 1, so reorganized it
|
||||
foreach($form->getSubForm("s".$i."_subform")->getValues() as $key => $d){
|
||||
$values[$key] = $d;
|
||||
}
|
||||
}
|
||||
}
|
||||
$values = $post_data;
|
||||
|
||||
if($form->isValid($post_data)){
|
||||
if(Application_Model_Preference::GetPlanLevel() == 'disabled'){
|
||||
$values['output_sound_device'] = $form->getValue('output_sound_device');
|
||||
|
@ -215,8 +204,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$values['output_sound_device_type'] = $form->getValue('output_sound_device_type');
|
||||
$values['streamFormat'] = $form->getValue('streamFormat');
|
||||
|
||||
}
|
||||
if(!$error){
|
||||
Application_Model_StreamSetting::setStreamSetting($values);
|
||||
$data = array();
|
||||
$data['setting'] = Application_Model_StreamSetting::getStreamSetting();
|
||||
|
@ -225,6 +212,10 @@ class PreferenceController extends Zend_Controller_Action
|
|||
}
|
||||
// this goes into cc_pref table
|
||||
Application_Model_Preference::SetStreamLabelFormat($values['streamFormat']);
|
||||
Application_Model_Preference::SetLiveSteamAutoEnable($values["auto_enable_live_stream"]);
|
||||
Application_Model_Preference::SetLiveSteamMasterUsername($values["master_username"]);
|
||||
Application_Model_Preference::SetLiveSteamMasterPassword($values["master_password"]);
|
||||
|
||||
// store stream update timestamp
|
||||
Application_Model_Preference::SetStreamUpdateTimestamp();
|
||||
Application_Model_RabbitMq::SendMessageToPypo("update_stream_setting", $data);
|
||||
|
|
|
@ -478,6 +478,8 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$formWho->populate(array('add_show_hosts' => $hosts));
|
||||
$formStyle->populate(array('add_show_background_color' => $show->getBackgroundColor(),
|
||||
'add_show_color' => $show->getColor()));
|
||||
|
||||
$formLive->populate($show->getLiveStreamInfo());
|
||||
|
||||
if(!$isSaas){
|
||||
$formRecord = new Application_Form_AddShowRR();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue