CC-2607: Ability to adjust stream bitrate, type, etc from UI interface

- created table cc_stream_setting and it's initial entries
- pypo installation will generate liquidsoap.cfg on install time
based on information on cc_stream_setting table
This commit is contained in:
James 2011-08-12 15:19:30 -04:00
parent 1c81d0d238
commit 13285fdd63
16 changed files with 1952 additions and 3 deletions

View file

@ -19,6 +19,7 @@ class ApiController extends Zend_Controller_Action
->addActionContext('add-watched-dir', 'json')
->addActionContext('remove-watched-dir', 'json')
->addActionContext('set-storage-dir', 'json')
->addActionContext('get-stream-setting', 'json')
->initContext();
}
@ -606,5 +607,24 @@ class ApiController extends Zend_Controller_Action
$this->view->msg = MusicDir::setStorDir($path);
}
public function getStreamSettingAction() {
global $CC_CONFIG, $CC_DBC;
$request = $this->getRequest();
$api_key = $request->getParam('api_key');
if (!in_array($api_key, $CC_CONFIG["apiKey"]))
{
header('HTTP/1.0 401 Unauthorized');
print 'You are not allowed to access this resource.';
exit;
}
$sql = "SELECT *"
." FROM cc_stream_setting";
$rows = $CC_DBC->getAll($sql);
$this->view->msg = $rows;
}
}