Merge branch '1.9.1' into devel
Conflicts: VERSION airtime_mvc/application/configs/constants.php airtime_mvc/application/models/Preference.php install_minimal/include/airtime-db-install.php install_minimal/include/airtime-upgrade.php python_apps/api_clients/api_client.py
This commit is contained in:
commit
9eb21cb327
11
Changelog
11
Changelog
|
@ -1,3 +1,14 @@
|
||||||
|
1.9.1 - August 17th, 2011
|
||||||
|
*Fixes
|
||||||
|
-airtime-user shell script failing to start
|
||||||
|
-Progress bar for tracks appearing when no content scheduled
|
||||||
|
-Fix upgrades from Airtime 1.8.2 failing
|
||||||
|
-Fix various install issues with virtualenv
|
||||||
|
-Prevent users from doing a manual install of Airtime if they already have the
|
||||||
|
Debian package version installed
|
||||||
|
*Changes
|
||||||
|
-Support Settings moved to a seperate page accessible by Admin user only.
|
||||||
|
|
||||||
1.9.0 - August 9, 2011
|
1.9.0 - August 9, 2011
|
||||||
|
|
||||||
The cool stuff:
|
The cool stuff:
|
||||||
|
|
|
@ -434,6 +434,13 @@ class ApiController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->stor = MusicDir::getStorDir()->getDirectory();
|
$this->view->stor = MusicDir::getStorDir()->getDirectory();
|
||||||
|
|
||||||
|
$watchedDirs = MusicDir::getWatchedDirs();
|
||||||
|
$watchedDirsPath = array();
|
||||||
|
foreach($watchedDirs as $wd){
|
||||||
|
$watchedDirsPath[] = $wd->getDirectory();
|
||||||
|
}
|
||||||
|
$this->view->watched_dirs = $watchedDirsPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function reloadMetadataAction() {
|
public function reloadMetadataAction() {
|
||||||
|
|
|
@ -29,8 +29,11 @@ class NowplayingController extends Zend_Controller_Action
|
||||||
$form = new Application_Form_RegisterAirtime();
|
$form = new Application_Form_RegisterAirtime();
|
||||||
|
|
||||||
$values = $request->getPost();
|
$values = $request->getPost();
|
||||||
if ($values["Publicise"] != 1){
|
if ($values["Publicise"] != 1 && $form->isValid($values)){
|
||||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||||
|
if(isset($values["Privacy"])){
|
||||||
|
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||||
|
}
|
||||||
// unset session
|
// unset session
|
||||||
Zend_Session::namespaceUnset('referrer');
|
Zend_Session::namespaceUnset('referrer');
|
||||||
}
|
}
|
||||||
|
@ -49,6 +52,9 @@ class NowplayingController extends Zend_Controller_Action
|
||||||
Application_Model_Preference::SetStationDescription($values["Description"]);
|
Application_Model_Preference::SetStationDescription($values["Description"]);
|
||||||
Application_Model_Preference::SetStationLogo($imagePath);
|
Application_Model_Preference::SetStationLogo($imagePath);
|
||||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||||
|
if(isset($values["Privacy"])){
|
||||||
|
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||||
|
}
|
||||||
// unset session
|
// unset session
|
||||||
Zend_Session::namespaceUnset('referrer');
|
Zend_Session::namespaceUnset('referrer');
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -62,24 +62,29 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
$form = new Application_Form_SupportSettings();
|
$form = new Application_Form_SupportSettings();
|
||||||
|
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
if ($form->isValid($request->getPost())) {
|
$values = $request->getPost();
|
||||||
$values = $form->getValues();
|
if ($form->isValid($values)) {
|
||||||
|
if ($values["Publicise"] != 1){
|
||||||
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||||
Application_Model_Preference::SetPhone($values["Phone"]);
|
if(isset($values["Privacy"])){
|
||||||
Application_Model_Preference::SetEmail($values["Email"]);
|
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||||
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
|
}
|
||||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
}else{
|
||||||
Application_Model_Preference::SetPublicise($values["Publicise"]);
|
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
||||||
|
Application_Model_Preference::SetPhone($values["Phone"]);
|
||||||
$form->Logo->receive();
|
Application_Model_Preference::SetEmail($values["Email"]);
|
||||||
$imagePath = $form->Logo->getFileName();
|
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
|
||||||
|
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||||
Application_Model_Preference::SetStationCountry($values["Country"]);
|
Application_Model_Preference::SetPublicise($values["Publicise"]);
|
||||||
Application_Model_Preference::SetStationCity($values["City"]);
|
|
||||||
Application_Model_Preference::SetStationDescription($values["Description"]);
|
$form->Logo->receive();
|
||||||
Application_Model_Preference::SetStationLogo($imagePath);
|
$imagePath = $form->Logo->getFileName();
|
||||||
|
|
||||||
|
Application_Model_Preference::SetStationCountry($values["Country"]);
|
||||||
|
Application_Model_Preference::SetStationCity($values["City"]);
|
||||||
|
Application_Model_Preference::SetStationDescription($values["Description"]);
|
||||||
|
Application_Model_Preference::SetStationLogo($imagePath);
|
||||||
|
}
|
||||||
$this->view->statusMsg = "<div class='success'>Support setting updated.</div>";
|
$this->view->statusMsg = "<div class='success'>Support setting updated.</div>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,7 +92,13 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
if($logo){
|
if($logo){
|
||||||
$this->view->logoImg = $logo;
|
$this->view->logoImg = $logo;
|
||||||
}
|
}
|
||||||
|
$privacyChecked = false;
|
||||||
|
if(Application_Model_Preference::GetPrivacyPolicyCheck() == 1){
|
||||||
|
$privacyChecked = true;
|
||||||
|
}
|
||||||
|
$this->view->privacyChecked = $privacyChecked;
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
|
//$form->render($this->view);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function directoryConfigAction()
|
public function directoryConfigAction()
|
||||||
|
|
|
@ -8,10 +8,15 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
$this->setAction('/Nowplaying');
|
$this->setAction('/Nowplaying');
|
||||||
$this->setMethod('post');
|
$this->setMethod('post');
|
||||||
|
|
||||||
$country_list = Application_Model_Preference::GetCountryList();
|
$country_list = Application_Model_Preference::GetCountryList();
|
||||||
|
|
||||||
|
$privacyChecked = false;
|
||||||
|
if(Application_Model_Preference::GetPrivacyPolicyCheck() == 1){
|
||||||
|
$privacyChecked = true;
|
||||||
|
}
|
||||||
|
|
||||||
$this->setDecorators(array(
|
$this->setDecorators(array(
|
||||||
array('ViewScript', array('viewScript' => 'form/register-dialog.phtml')),
|
array('ViewScript', array('viewScript' => 'form/register-dialog.phtml', 'privacyChecked'=>$privacyChecked)),
|
||||||
array('File', array('viewScript' => 'form/register-dialog.phtml', 'placement' => false)))
|
array('File', array('viewScript' => 'form/register-dialog.phtml', 'placement' => false)))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -143,5 +148,22 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($checkboxPrivacy);
|
$this->addElement($checkboxPrivacy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// overriding isValid function
|
||||||
|
public function isValid ($data)
|
||||||
|
{
|
||||||
|
$isValid = parent::isValid($data);
|
||||||
|
if($data['Publicise'] != 1){
|
||||||
|
$isValid = true;
|
||||||
|
}
|
||||||
|
if(isset($data["Privacy"])){
|
||||||
|
$checkPrivacy = $this->getElement('Privacy');
|
||||||
|
if($data["SupportFeedback"] == "1" && $data["Privacy"] != "1"){
|
||||||
|
$checkPrivacy->addError("You have to agree to privacy policy.");
|
||||||
|
$isValid = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $isValid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$country_list = Application_Model_Preference::GetCountryList();
|
$country_list = Application_Model_Preference::GetCountryList();
|
||||||
|
|
||||||
$this->setDecorators(array(
|
$this->setDecorators(array(
|
||||||
array('ViewScript', array('viewScript' => 'form/support-setting.phtml')),
|
array('ViewScript', array('viewScript' => 'form/support-setting.phtml')),
|
||||||
array('File', array('viewScript' => 'form/support-setting.phtml', 'placement' => false)))
|
array('File', array('viewScript' => 'form/support-setting.phtml', 'placement' => false)))
|
||||||
|
@ -157,14 +157,19 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
$this->addElement($submit);
|
$this->addElement($submit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// overwriting isValid function
|
// overriding isValid function
|
||||||
public function isValid ($data)
|
public function isValid ($data)
|
||||||
{
|
{
|
||||||
$isValid = parent::isValid($data);
|
$isValid = parent::isValid($data);
|
||||||
$checkPrivacy = $this->getElement('Privacy');
|
if($data['Publicise'] != 1){
|
||||||
if($data["SupportFeedback"] == "1" && $data["Privacy"] != "1"){
|
$isValid = true;
|
||||||
$checkPrivacy->addError("You have to agree to privacy policy.");
|
}
|
||||||
$isValid = false;
|
if(isset($data["Privacy"])){
|
||||||
|
$checkPrivacy = $this->getElement('Privacy');
|
||||||
|
if($data["SupportFeedback"] == "1" && $data["Privacy"] != "1"){
|
||||||
|
$checkPrivacy->addError("You have to agree to privacy policy.");
|
||||||
|
$isValid = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $isValid;
|
return $isValid;
|
||||||
}
|
}
|
||||||
|
|
|
@ -386,5 +386,13 @@ class Application_Model_Preference
|
||||||
$sb = Application_Model_Preference::GetValue("stream_bitrate");
|
$sb = Application_Model_Preference::GetValue("stream_bitrate");
|
||||||
return explode(',', $sb);
|
return explode(',', $sb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function SetPrivacyPolicyCheck($flag){
|
||||||
|
Application_Model_Preference::SetValue("privacy_policy", $flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function GetPrivacyPolicyCheck(){
|
||||||
|
return Application_Model_Preference::GetValue("privacy_policy");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -166,10 +166,14 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<br>
|
<br>
|
||||||
<label class="optional" for="Privacy">
|
<?php if(!$this->privacyChecked){?>
|
||||||
<?php echo $this->element->getElement('Privacy') ?>
|
<label class="optional" for="Privacy">
|
||||||
<?php echo $this->element->getElement('Privacy')->getLabel() ?>
|
<?php echo $this->element->getElement('Privacy') ?>
|
||||||
</label>
|
<?php echo $this->element->getElement('Privacy')->getLabel() ?>
|
||||||
|
</label>
|
||||||
|
<?php }else{?>
|
||||||
|
<a id="link_to_terms_and_condition" href="http://www.sourcefabric.org/en/about/policy/" onclick="window.open(this.href); return false;">Terms and Conditions</a>
|
||||||
|
<?php }?>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
|
@ -159,16 +159,20 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<br>
|
<br>
|
||||||
<label class="optional" for="Privacy">
|
<?php if(!$this->element->getView()->privacyChecked){?>
|
||||||
<?php echo $this->element->getElement('Privacy') ?>
|
<label class="optional" for="Privacy">
|
||||||
<?php echo $this->element->getElement('Privacy')->getLabel() ?>
|
<?php echo $this->element->getElement('Privacy') ?>
|
||||||
</label>
|
<?php echo $this->element->getElement('Privacy')->getLabel() ?>
|
||||||
<?php if($this->element->getElement('Privacy')->hasErrors()) : ?>
|
</label>
|
||||||
<ul class='errors'>
|
<?php if($this->element->getElement('Privacy')->hasErrors()) : ?>
|
||||||
<?php foreach($this->element->getElement('Privacy')->getMessages() as $error): ?>
|
<ul class='errors'>
|
||||||
<li><?php echo $error; ?></li>
|
<?php foreach($this->element->getElement('Privacy')->getMessages() as $error): ?>
|
||||||
<?php endforeach; ?>
|
<li><?php echo $error; ?></li>
|
||||||
</ul>
|
<?php endforeach; ?>
|
||||||
<?php endif; ?>
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php }else{?>
|
||||||
|
<a id="link_to_terms_and_condition" href="http://www.sourcefabric.org/en/about/policy/" onclick="window.open(this.href); return false;">Terms and Conditions</a>
|
||||||
|
<?php }?>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
|
@ -36,7 +36,12 @@ $(document).ready(function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
var button = $("#help_airtime");
|
var button = $("#help_airtime");
|
||||||
button.attr('disabled', 'disabled').addClass('ui-state-disabled');
|
|
||||||
|
if($("#link_to_terms_and_condition").length > 0 ){
|
||||||
|
button.removeAttr('disabled').removeClass('ui-state-disabled');
|
||||||
|
}else{
|
||||||
|
button.attr('disabled', 'disabled' ).addClass('ui-state-disabled');
|
||||||
|
}
|
||||||
dialog.dialog('open');
|
dialog.dialog('open');
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,7 +62,7 @@ $(document).ready(function(){
|
||||||
button.attr('disabled', 'disabled' ).addClass('ui-state-disabled');
|
button.attr('disabled', 'disabled' ).addClass('ui-state-disabled');
|
||||||
}else{
|
}else{
|
||||||
pub.removeAttr("disabled");
|
pub.removeAttr("disabled");
|
||||||
if(privacy.is(':checked')){
|
if(privacy.length == 0 || privacy.is(':checked')){
|
||||||
button.removeAttr('disabled').removeClass('ui-state-disabled');
|
button.removeAttr('disabled').removeClass('ui-state-disabled');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +90,7 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if($("#SupportFeedback").is(':checked') && $("#Privacy").is(':checked')){
|
if($("#SupportFeedback").is(':checked') && ($("#Privacy").length == 0 || $("#Privacy").is(':checked'))){
|
||||||
button.removeAttr('disabled').removeClass('ui-state-disabled');
|
button.removeAttr('disabled').removeClass('ui-state-disabled');
|
||||||
}else{
|
}else{
|
||||||
button.attr('disabled', 'disabled' ).addClass('ui-state-disabled');
|
button.attr('disabled', 'disabled' ).addClass('ui-state-disabled');
|
||||||
|
|
|
@ -52,7 +52,10 @@ $(document).ready(function() {
|
||||||
if(!$("#SupportFeedback").is(':checked')){
|
if(!$("#SupportFeedback").is(':checked')){
|
||||||
promote.removeAttr("checked");
|
promote.removeAttr("checked");
|
||||||
promote.attr("disabled", true);
|
promote.attr("disabled", true);
|
||||||
|
}else{
|
||||||
|
promote.removeAttr("disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
promote.live('click', function(){
|
promote.live('click', function(){
|
||||||
if($(this).is(':checked')){
|
if($(this).is(':checked')){
|
||||||
$("#public-info").show();
|
$("#public-info").show();
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
ServerAdmin foo@bar.org
|
ServerAdmin foo@bar.org
|
||||||
DocumentRoot /var/www/airtime/public
|
DocumentRoot /usr/share/airtime/public
|
||||||
php_admin_value upload_tmp_dir /tmp
|
php_admin_value upload_tmp_dir /tmp
|
||||||
|
|
||||||
<Directory /var/www/airtime/public>
|
<Directory /usr/share/airtime/public>
|
||||||
DirectoryIndex index.php
|
DirectoryIndex index.php
|
||||||
AllowOverride all
|
AllowOverride all
|
||||||
Order allow,deny
|
Order allow,deny
|
||||||
|
|
|
@ -6,7 +6,7 @@ require_once('DB.php');
|
||||||
class AirtimeInstall
|
class AirtimeInstall
|
||||||
{
|
{
|
||||||
const CONF_DIR_BINARIES = "/usr/lib/airtime";
|
const CONF_DIR_BINARIES = "/usr/lib/airtime";
|
||||||
const CONF_DIR_WWW = "/var/www/airtime";
|
const CONF_DIR_WWW = "/usr/share/airtime/";
|
||||||
const CONF_DIR_LOG = "/var/log/airtime";
|
const CONF_DIR_LOG = "/var/log/airtime";
|
||||||
|
|
||||||
public static $databaseTablesCreated = false;
|
public static $databaseTablesCreated = false;
|
||||||
|
|
|
@ -47,12 +47,12 @@ if (isset($argv[1]) && $argv[1] == 'y') {
|
||||||
echo "* Setting Airtime version".PHP_EOL;
|
echo "* Setting Airtime version".PHP_EOL;
|
||||||
AirtimeInstall::SetAirtimeVersion(AIRTIME_VERSION);
|
AirtimeInstall::SetAirtimeVersion(AIRTIME_VERSION);
|
||||||
|
|
||||||
// set up some keys in DB
|
|
||||||
AirtimeInstall::SetUniqueId();
|
|
||||||
AirtimeInstall::SetImportTimestamp();
|
|
||||||
|
|
||||||
if (AirtimeInstall::$databaseTablesCreated) {
|
if (AirtimeInstall::$databaseTablesCreated) {
|
||||||
AirtimeInstall::SetDefaultTimezone();
|
AirtimeInstall::SetDefaultTimezone();
|
||||||
|
// set up some keys in DB
|
||||||
|
AirtimeInstall::SetUniqueId();
|
||||||
|
AirtimeInstall::SetImportTimestamp();
|
||||||
|
|
||||||
$ini = parse_ini_file(__DIR__."/airtime-install.ini");
|
$ini = parse_ini_file(__DIR__."/airtime-install.ini");
|
||||||
|
|
||||||
|
|
|
@ -44,29 +44,6 @@ if (PEAR::isError($CC_DBC)) {
|
||||||
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
$sql = "SELECT valstr FROM cc_pref WHERE keystr = 'system_version'";
|
|
||||||
$version = $CC_DBC->GetOne($sql);
|
|
||||||
|
|
||||||
if (PEAR::isError($version)) {
|
|
||||||
$version = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$version){
|
|
||||||
|
|
||||||
$sql = "SELECT * FROM cc_show_rebroadcast LIMIT 1";
|
|
||||||
$result = $CC_DBC->GetOne($sql);
|
|
||||||
if (!PEAR::isError($result)) {
|
|
||||||
$version = "1.7.0";
|
|
||||||
echo "Airtime Version: ".$version." ".PHP_EOL;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$version = "1.6";
|
|
||||||
echo "Airtime Version: ".$version." ".PHP_EOL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
$version = AirtimeInstall::GetVersionInstalled();
|
$version = AirtimeInstall::GetVersionInstalled();
|
||||||
|
|
||||||
echo "******************************** Update Begin *********************************".PHP_EOL;
|
echo "******************************** Update Begin *********************************".PHP_EOL;
|
||||||
|
@ -89,11 +66,13 @@ if (strcmp($version, "1.8.2") < 0){
|
||||||
if (strcmp($version, "1.9.0") < 0){
|
if (strcmp($version, "1.9.0") < 0){
|
||||||
system("php ".__DIR__."/../upgrades/airtime-1.9.0/airtime-upgrade.php");
|
system("php ".__DIR__."/../upgrades/airtime-1.9.0/airtime-upgrade.php");
|
||||||
}
|
}
|
||||||
|
if (strcmp($version, "1.9.2") < 0){
|
||||||
|
system("php ".__DIR__."/../upgrades/airtime-1.9.2/airtime-upgrade.php");
|
||||||
|
}
|
||||||
if (strcmp($version, "2.0.0") < 0){
|
if (strcmp($version, "2.0.0") < 0){
|
||||||
system("php ".__DIR__."/../upgrades/airtime-2.0.0/airtime-upgrade.php");
|
system("php ".__DIR__."/../upgrades/airtime-2.0.0/airtime-upgrade.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//set the new version in the database.
|
//set the new version in the database.
|
||||||
$sql = "DELETE FROM cc_pref WHERE keystr = 'system_version'";
|
$sql = "DELETE FROM cc_pref WHERE keystr = 'system_version'";
|
||||||
$CC_DBC->query($sql);
|
$CC_DBC->query($sql);
|
||||||
|
|
|
@ -22,13 +22,6 @@ class AirtimeInstall{
|
||||||
const CONF_DIR_LOG = "/var/log/airtime";
|
const CONF_DIR_LOG = "/var/log/airtime";
|
||||||
const CONF_DIR_BINARIES = "/usr/lib/airtime";
|
const CONF_DIR_BINARIES = "/usr/lib/airtime";
|
||||||
|
|
||||||
public static function CreateSymlinksToUtils()
|
|
||||||
{
|
|
||||||
echo "* Installing airtime-user".PHP_EOL;
|
|
||||||
$dir = AirtimeInstall::CONF_DIR_BINARIES."/utils/airtime-user";
|
|
||||||
exec("ln -s $dir /usr/bin/airtime-user");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function CreateZendPhpLogFile(){
|
public static function CreateZendPhpLogFile(){
|
||||||
global $CC_CONFIG;
|
global $CC_CONFIG;
|
||||||
|
|
||||||
|
@ -62,6 +55,10 @@ class AirtimeInstall{
|
||||||
echo "* Installing airtime-check-system".PHP_EOL;
|
echo "* Installing airtime-check-system".PHP_EOL;
|
||||||
$dir = CONF_DIR_BINARIES."/utils/airtime-check-system";
|
$dir = CONF_DIR_BINARIES."/utils/airtime-check-system";
|
||||||
exec("ln -s $dir /usr/bin/airtime-check-system");
|
exec("ln -s $dir /usr/bin/airtime-check-system");
|
||||||
|
|
||||||
|
echo "* Installing airtime-user".PHP_EOL;
|
||||||
|
$dir = AirtimeInstall::CONF_DIR_BINARIES."/utils/airtime-user";
|
||||||
|
exec("ln -s $dir /usr/bin/airtime-user");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function RemoveSymlinks()
|
public static function RemoveSymlinks()
|
||||||
|
@ -577,14 +574,15 @@ class Airtime190Upgrade{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function removeOldAirtimeImport(){
|
// we don't need thses functions anymore as it's done in CreateSymlinksToUtils()
|
||||||
|
/*public static function removeOldAirtimeImport(){
|
||||||
exec('rm -f "/usr/bin/airtime-import"');
|
exec('rm -f "/usr/bin/airtime-import"');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function updateAirtimeImportSymLink(){
|
public static function updateAirtimeImportSymLink(){
|
||||||
$dir = "/usr/lib/airtime/utils/airtime-import/airtime-import";
|
$dir = "/usr/lib/airtime/utils/airtime-import/airtime-import";
|
||||||
exec("ln -s $dir /usr/bin/airtime-import");
|
exec("ln -s $dir /usr/bin/airtime-import");
|
||||||
}
|
}*/
|
||||||
|
|
||||||
public static function execSqlQuery($sql){
|
public static function execSqlQuery($sql){
|
||||||
global $CC_DBC;
|
global $CC_DBC;
|
||||||
|
@ -801,8 +799,9 @@ Airtime190Upgrade::CopyUtils();
|
||||||
/* James made a new airtime-import script, lets remove the old airtime-import php script,
|
/* James made a new airtime-import script, lets remove the old airtime-import php script,
|
||||||
*install the new airtime-import.py script and update the /usr/bin/symlink.
|
*install the new airtime-import.py script and update the /usr/bin/symlink.
|
||||||
*/
|
*/
|
||||||
Airtime190Upgrade::removeOldAirtimeImport();
|
// we don't need thses functions anymore as it's done in CreateSymlinksToUtils()
|
||||||
Airtime190Upgrade::updateAirtimeImportSymLink();
|
/*Airtime190Upgrade::removeOldAirtimeImport();
|
||||||
|
Airtime190Upgrade::updateAirtimeImportSymLink();*/
|
||||||
|
|
||||||
Airtime190Upgrade::connectToDatabase();
|
Airtime190Upgrade::connectToDatabase();
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
set daemon 10 # Poll at 10 second intervals
|
||||||
|
set logfile syslog facility log_daemon
|
||||||
|
|
||||||
|
set httpd port 2812 and use address 127.0.0.1
|
||||||
|
allow localhost
|
||||||
|
allow admin:monit
|
||||||
|
|
||||||
|
check process airtime-playout
|
||||||
|
with pidfile "/var/run/airtime-playout.pid"
|
||||||
|
start program = "/etc/init.d/airtime-playout start" with timeout 10 seconds
|
||||||
|
stop program = "/etc/init.d/airtime-playout stop"
|
||||||
|
check process airtime-liquidsoap
|
||||||
|
with pidfile "/var/run/airtime-liquidsoap.pid"
|
||||||
|
start program = "/etc/init.d/airtime-playout start" with timeout 10 seconds
|
||||||
|
stop program = "/etc/init.d/airtime-playout stop"
|
||||||
|
# check process airtime-media-monitor
|
||||||
|
# with pidfile "/var/run/airtime-media-monitor.pid"
|
||||||
|
# start program = "/etc/init.d/airtime-media-monitor start" with timeout 10 seconds
|
||||||
|
# stop program = "/etc/init.d/airtime-media-monitor stop"
|
||||||
|
check process airtime-show-recorder
|
||||||
|
with pidfile "/var/run/airtime-show-recorder.pid"
|
||||||
|
start program = "/etc/init.d/airtime-show-recorder start" with timeout 10 seconds
|
||||||
|
stop program = "/etc/init.d/airtime-show-recorder stop"
|
|
@ -0,0 +1,184 @@
|
||||||
|
<?php
|
||||||
|
class Airtime192Upgrade{
|
||||||
|
|
||||||
|
public static function InstallAirtimePhpServerCode($phpDir)
|
||||||
|
{
|
||||||
|
|
||||||
|
$AIRTIME_SRC = realpath(__DIR__.'/../../../airtime_mvc');
|
||||||
|
|
||||||
|
echo "* Installing PHP code to ".$phpDir.PHP_EOL;
|
||||||
|
exec("mkdir -p ".$phpDir);
|
||||||
|
exec("cp -R ".$AIRTIME_SRC."/* ".$phpDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class AirtimeIni192{
|
||||||
|
|
||||||
|
const CONF_FILE_AIRTIME = "/etc/airtime/airtime.conf";
|
||||||
|
const CONF_FILE_PYPO = "/etc/airtime/pypo.cfg";
|
||||||
|
const CONF_FILE_RECORDER = "/etc/airtime/recorder.cfg";
|
||||||
|
const CONF_FILE_LIQUIDSOAP = "/etc/airtime/liquidsoap.cfg";
|
||||||
|
const CONF_FILE_MEDIAMONITOR = "/etc/airtime/media-monitor.cfg";
|
||||||
|
const CONF_FILE_API_CLIENT = "/etc/airtime/api_client.cfg";
|
||||||
|
const CONF_FILE_MONIT = "/etc/monit/conf.d/airtime-monit.cfg";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function updates an INI style config file.
|
||||||
|
*
|
||||||
|
* A property and the value the property should be changed to are
|
||||||
|
* supplied. If the property is not found, then no changes are made.
|
||||||
|
*
|
||||||
|
* @param string $p_filename
|
||||||
|
* The path the to the file.
|
||||||
|
* @param string $p_property
|
||||||
|
* The property to look for in order to change its value.
|
||||||
|
* @param string $p_value
|
||||||
|
* The value the property should be changed to.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public static function UpdateIniValue($p_filename, $p_property, $p_value)
|
||||||
|
{
|
||||||
|
$lines = file($p_filename);
|
||||||
|
$n=count($lines);
|
||||||
|
foreach ($lines as &$line) {
|
||||||
|
if ($line[0] != "#"){
|
||||||
|
$key_value = explode("=", $line);
|
||||||
|
$key = trim($key_value[0]);
|
||||||
|
|
||||||
|
if ($key == $p_property){
|
||||||
|
$line = "$p_property = $p_value".PHP_EOL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$fp=fopen($p_filename, 'w');
|
||||||
|
for($i=0; $i<$n; $i++){
|
||||||
|
fwrite($fp, $lines[$i]);
|
||||||
|
}
|
||||||
|
fclose($fp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function ReadPythonConfig($p_filename)
|
||||||
|
{
|
||||||
|
$values = array();
|
||||||
|
|
||||||
|
$lines = file($p_filename);
|
||||||
|
$n=count($lines);
|
||||||
|
for ($i=0; $i<$n; $i++) {
|
||||||
|
if (strlen($lines[$i]) && !in_array(substr($lines[$i], 0, 1), array('#', PHP_EOL))){
|
||||||
|
$info = explode("=", $lines[$i]);
|
||||||
|
$values[trim($info[0])] = trim($info[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $values;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function MergeConfigFiles($configFiles, $suffix) {
|
||||||
|
foreach ($configFiles as $conf) {
|
||||||
|
if (file_exists("$conf$suffix.bak")) {
|
||||||
|
|
||||||
|
if($conf === AirtimeIni192::CONF_FILE_AIRTIME) {
|
||||||
|
// Parse with sections
|
||||||
|
$newSettings = parse_ini_file($conf, true);
|
||||||
|
$oldSettings = parse_ini_file("$conf$suffix.bak", true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$newSettings = AirtimeIni192::ReadPythonConfig($conf);
|
||||||
|
$oldSettings = AirtimeIni192::ReadPythonConfig("$conf$suffix.bak");
|
||||||
|
}
|
||||||
|
|
||||||
|
$settings = array_keys($newSettings);
|
||||||
|
|
||||||
|
foreach($settings as $section) {
|
||||||
|
// skip airtim_dir as we want to use new value
|
||||||
|
if(isset($oldSettings[$section])) {
|
||||||
|
if(is_array($oldSettings[$section])) {
|
||||||
|
$sectionKeys = array_keys($newSettings[$section]);
|
||||||
|
foreach($sectionKeys as $sectionKey) {
|
||||||
|
if($sectionKey != "airtime_dir"){
|
||||||
|
if(isset($oldSettings[$section][$sectionKey])) {
|
||||||
|
AirtimeIni192::UpdateIniValue($conf, $sectionKey, $oldSettings[$section][$sectionKey]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
AirtimeIni192::UpdateIniValue($conf, $section, $oldSettings[$section]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function upgradeConfigFiles(){
|
||||||
|
|
||||||
|
$configFiles = array(AirtimeIni192::CONF_FILE_AIRTIME,
|
||||||
|
AirtimeIni192::CONF_FILE_PYPO,
|
||||||
|
AirtimeIni192::CONF_FILE_RECORDER,
|
||||||
|
AirtimeIni192::CONF_FILE_LIQUIDSOAP);
|
||||||
|
|
||||||
|
// Backup the config files
|
||||||
|
$suffix = date("Ymdhis")."-1.9.0";
|
||||||
|
foreach ($configFiles as $conf) {
|
||||||
|
if (file_exists($conf)) {
|
||||||
|
echo "Backing up $conf to $conf$suffix.bak".PHP_EOL;
|
||||||
|
copy($conf, $conf.$suffix.".bak");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$default_suffix = "192";
|
||||||
|
AirtimeIni192::CreateIniFiles($default_suffix);
|
||||||
|
AirtimeIni192::MergeConfigFiles($configFiles, $suffix);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function creates the /etc/airtime configuration folder
|
||||||
|
* and copies the default config files to it.
|
||||||
|
*/
|
||||||
|
public static function CreateIniFiles($suffix)
|
||||||
|
{
|
||||||
|
if (!file_exists("/etc/airtime/")){
|
||||||
|
if (!mkdir("/etc/airtime/", 0755, true)){
|
||||||
|
echo "Could not create /etc/airtime/ directory. Exiting.";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!copy(__DIR__."/airtime.conf.$suffix", AirtimeIni192::CONF_FILE_AIRTIME)){
|
||||||
|
echo "Could not copy airtime.conf to /etc/airtime/. Exiting.";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
if (!copy(__DIR__."/pypo.cfg.$suffix", AirtimeIni192::CONF_FILE_PYPO)){
|
||||||
|
echo "Could not copy pypo.cfg to /etc/airtime/. Exiting.";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
if (!copy(__DIR__."/recorder.cfg.$suffix", AirtimeIni192::CONF_FILE_RECORDER)){
|
||||||
|
echo "Could not copy recorder.cfg to /etc/airtime/. Exiting.";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
if (!copy(__DIR__."/liquidsoap.cfg.$suffix", AirtimeIni192::CONF_FILE_LIQUIDSOAP)){
|
||||||
|
echo "Could not copy liquidsoap.cfg to /etc/airtime/. Exiting.";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// change site-available/airtime and restart apache
|
||||||
|
echo "* Reconfiguring Apache\n";
|
||||||
|
exec("find /etc/apache2/sites-available/ -name '*' -type f -exec sed -i 's/\/var\/www\/airtime\/public/\/usr\/share\/airtime\/public/g' '{}' \;");
|
||||||
|
exec("service apache2 restart");
|
||||||
|
|
||||||
|
echo "* Updating configFiles\n";
|
||||||
|
AirtimeIni192::upgradeConfigFiles();
|
||||||
|
|
||||||
|
// delete files in /var/www/airtime
|
||||||
|
echo "* Deleting old PHP codes\n";
|
||||||
|
exec("rm -rf /var/www/airtime");
|
||||||
|
|
||||||
|
$values = parse_ini_file(AirtimeIni192::CONF_FILE_AIRTIME, true);
|
||||||
|
$phpDir = $values['general']['airtime_dir'];
|
||||||
|
Airtime192Upgrade::InstallAirtimePhpServerCode($phpDir);
|
||||||
|
?>
|
|
@ -0,0 +1,23 @@
|
||||||
|
[database]
|
||||||
|
host = localhost
|
||||||
|
dbname = airtime
|
||||||
|
dbuser = airtime
|
||||||
|
dbpass = airtime
|
||||||
|
|
||||||
|
[rabbitmq]
|
||||||
|
host = 127.0.0.1
|
||||||
|
port = 5672
|
||||||
|
user = guest
|
||||||
|
password = guest
|
||||||
|
vhost = /
|
||||||
|
|
||||||
|
[general]
|
||||||
|
api_key = AAA
|
||||||
|
web_server_user = www-data
|
||||||
|
airtime_dir = /usr/share/airtime/
|
||||||
|
base_url = localhost
|
||||||
|
base_port = 80
|
||||||
|
|
||||||
|
[soundcloud]
|
||||||
|
connection_retries = 3
|
||||||
|
time_between_retries = 60
|
|
@ -0,0 +1,110 @@
|
||||||
|
bin_dir = "/usr/lib/airtime/api_clients"
|
||||||
|
|
||||||
|
#############################
|
||||||
|
## Common
|
||||||
|
#############################
|
||||||
|
|
||||||
|
# Value needed to access the API
|
||||||
|
api_key = 'AAA'
|
||||||
|
|
||||||
|
# Path to the base of the API
|
||||||
|
api_base = 'api'
|
||||||
|
|
||||||
|
# URL to get the version number of the server API
|
||||||
|
version_url = 'version/api_key/%%api_key%%'
|
||||||
|
|
||||||
|
# Hostname
|
||||||
|
base_url = 'localhost'
|
||||||
|
base_port = 80
|
||||||
|
|
||||||
|
#############################
|
||||||
|
## Config for Media Monitor
|
||||||
|
#############################
|
||||||
|
|
||||||
|
# URL to setup the media monitor
|
||||||
|
media_setup_url = 'media-monitor-setup/format/json/api_key/%%api_key%%'
|
||||||
|
|
||||||
|
# Tell Airtime the file id associated with a show instance.
|
||||||
|
upload_recorded = 'upload-recorded/format/json/api_key/%%api_key%%/fileid/%%fileid%%/showinstanceid/%%showinstanceid%%'
|
||||||
|
|
||||||
|
# URL to tell Airtime to update file's meta data
|
||||||
|
update_media_url = 'reload-metadata/format/json/api_key/%%api_key%%/mode/%%mode%%'
|
||||||
|
|
||||||
|
# URL to tell Airtime we want a listing of all files it knows about
|
||||||
|
list_all_db_files = 'list-all-files/format/json/api_key/%%api_key%%/dir_id/%%dir_id%%'
|
||||||
|
|
||||||
|
# URL to tell Airtime we want a listing of all dirs its watching (including the stor dir)
|
||||||
|
list_all_watched_dirs = 'list-all-watched-dirs/format/json/api_key/%%api_key%%'
|
||||||
|
|
||||||
|
# URL to tell Airtime we want to add watched directory
|
||||||
|
add_watched_dir = 'add-watched-dir/format/json/api_key/%%api_key%%/path/%%path%%'
|
||||||
|
|
||||||
|
# URL to tell Airtime we want to add watched directory
|
||||||
|
remove_watched_dir = 'remove-watched-dir/format/json/api_key/%%api_key%%/path/%%path%%'
|
||||||
|
|
||||||
|
# URL to tell Airtime we want to add watched directory
|
||||||
|
set_storage_dir = 'set-storage-dir/format/json/api_key/%%api_key%%/path/%%path%%'
|
||||||
|
|
||||||
|
|
||||||
|
#############################
|
||||||
|
## Config for Recorder
|
||||||
|
#############################
|
||||||
|
|
||||||
|
# URL to get the schedule of shows set to record
|
||||||
|
show_schedule_url = 'recorded-shows/format/json/api_key/%%api_key%%'
|
||||||
|
|
||||||
|
# URL to upload the recorded show's file to Airtime
|
||||||
|
upload_file_url = 'upload-file/format/json/api_key/%%api_key%%'
|
||||||
|
|
||||||
|
#number of retries to upload file if connection problem
|
||||||
|
upload_retries = 3
|
||||||
|
|
||||||
|
#time to wait between attempts to upload file if connection problem (in seconds)
|
||||||
|
upload_wait = 60
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Uncomment *one of the sets* of values from the API clients below, and comment
|
||||||
|
# out all the others.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
#############################
|
||||||
|
## Config for Pypo
|
||||||
|
#############################
|
||||||
|
|
||||||
|
# Schedule export path.
|
||||||
|
# %%from%% - starting date/time in the form YYYY-MM-DD-hh-mm
|
||||||
|
# %%to%% - starting date/time in the form YYYY-MM-DD-hh-mm
|
||||||
|
export_url = 'schedule/api_key/%%api_key%%'
|
||||||
|
|
||||||
|
get_media_url = 'get-media/file/%%file%%/api_key/%%api_key%%'
|
||||||
|
|
||||||
|
# Update whether a schedule group has begun playing.
|
||||||
|
update_item_url = 'notify-schedule-group-play/api_key/%%api_key%%/schedule_id/%%schedule_id%%'
|
||||||
|
|
||||||
|
# Update whether an audio clip is currently playing.
|
||||||
|
update_start_playing_url = 'notify-media-item-start-play/api_key/%%api_key%%/media_id/%%media_id%%/schedule_id/%%schedule_id%%'
|
||||||
|
|
||||||
|
# ???
|
||||||
|
generate_range_url = 'generate_range_dp.php'
|
||||||
|
|
||||||
|
|
||||||
|
##############
|
||||||
|
# OBP config #
|
||||||
|
##############
|
||||||
|
|
||||||
|
# URL to get the version number of the server API
|
||||||
|
#version_url = 'api/pypo/status/json'
|
||||||
|
|
||||||
|
# Schedule export path.
|
||||||
|
# %%from%% - starting date/time in the form YYYY-MM-DD-hh-mm
|
||||||
|
# %%to%% - starting date/time in the form YYYY-MM-DD-hh-mm
|
||||||
|
|
||||||
|
# Update whether an item has been played.
|
||||||
|
#update_item_url = 'api/pypo/update_shedueled_item/$$item_id%%?played=%%played%%'
|
||||||
|
|
||||||
|
# Update whether an item is currently playing.
|
||||||
|
#update_start_playing_url = 'api/pypo/mod/medialibrary/?playlist_type=%%playlist_type%%&export_source=%%export_source%%&media_id=%%media_id%%&playlist_id=%%playlist_id%%&transmission_id=%%transmission_id%%'
|
||||||
|
|
||||||
|
# ???
|
||||||
|
#generate_range_url = 'api/pypo/generate_range_dp/'
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
###########################################
|
||||||
|
# Liquidsoap config file #
|
||||||
|
###########################################
|
||||||
|
|
||||||
|
###########################################
|
||||||
|
# Output settings #
|
||||||
|
###########################################
|
||||||
|
output_sound_device = false
|
||||||
|
output_icecast_vorbis = true
|
||||||
|
output_icecast_mp3 = false
|
||||||
|
output_shoutcast = false
|
||||||
|
|
||||||
|
#output_bitrate = 128
|
||||||
|
#output_samplerate = 44100
|
||||||
|
#output_stereo = true
|
||||||
|
|
||||||
|
###########################################
|
||||||
|
# Logging settings #
|
||||||
|
###########################################
|
||||||
|
log_file = "/var/log/airtime/pypo-liquidsoap/<script>.log"
|
||||||
|
#log_level = 3
|
||||||
|
|
||||||
|
###########################################
|
||||||
|
# Icecast Stream settings #
|
||||||
|
###########################################
|
||||||
|
icecast_host = "127.0.0.1"
|
||||||
|
icecast_port = 8000
|
||||||
|
icecast_pass = "hackme"
|
||||||
|
|
||||||
|
# Icecast mountpoint names
|
||||||
|
mount_point_mp3 = "airtime.mp3"
|
||||||
|
mount_point_vorbis = "airtime.ogg"
|
||||||
|
|
||||||
|
# Webstream metadata settings
|
||||||
|
icecast_url = "http://airtime.sourcefabric.org"
|
||||||
|
icecast_description = "Airtime Radio!"
|
||||||
|
icecast_genre = "genre"
|
||||||
|
|
||||||
|
# Audio stream metadata for vorbis/ogg is disabled by default
|
||||||
|
# due to a number of client media players that disconnect
|
||||||
|
# when the metadata changes to a new track. Some versions of
|
||||||
|
# mplayer and VLC have this problem. Enable this option at your
|
||||||
|
# own risk!
|
||||||
|
output_icecast_vorbis_metadata = false
|
||||||
|
|
||||||
|
###########################################
|
||||||
|
# Shoutcast Stream settings #
|
||||||
|
###########################################
|
||||||
|
shoutcast_host = "127.0.0.1"
|
||||||
|
shoutcast_port = 9000
|
||||||
|
shoutcast_pass = "testing"
|
||||||
|
|
||||||
|
# Webstream metadata settings
|
||||||
|
shoutcast_url = "http://airtime.sourcefabric.org"
|
||||||
|
shoutcast_genre = "genre"
|
|
@ -0,0 +1,21 @@
|
||||||
|
api_client = "airtime"
|
||||||
|
|
||||||
|
# where the binary files live
|
||||||
|
bin_dir = '/usr/lib/airtime/media-monitor'
|
||||||
|
|
||||||
|
# where the logging files live
|
||||||
|
log_dir = '/var/log/airtime/media-monitor'
|
||||||
|
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# RabbitMQ settings #
|
||||||
|
############################################
|
||||||
|
rabbitmq_host = 'localhost'
|
||||||
|
rabbitmq_user = 'guest'
|
||||||
|
rabbitmq_password = 'guest'
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# Media-Monitor preferences #
|
||||||
|
############################################
|
||||||
|
check_filesystem_events = 5 #how long to queue up events performed on the files themselves.
|
||||||
|
check_airtime_events = 30 #how long to queue metadata input from airtime.
|
|
@ -0,0 +1,72 @@
|
||||||
|
############################################
|
||||||
|
# pypo - configuration #
|
||||||
|
############################################
|
||||||
|
|
||||||
|
# Set the type of client you are using.
|
||||||
|
# Currently supported types:
|
||||||
|
# 1) "obp" = Open Broadcast Platform
|
||||||
|
# 2) "airtime"
|
||||||
|
#
|
||||||
|
api_client = "airtime"
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# Cache Directories #
|
||||||
|
# *include* trailing slash !! #
|
||||||
|
############################################
|
||||||
|
cache_dir = '/var/tmp/airtime/pypo/cache/'
|
||||||
|
file_dir = '/var/tmp/airtime/pypo/files/'
|
||||||
|
tmp_dir = '/var/tmp/airtime/pypo/tmp/'
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# Setup Directories #
|
||||||
|
# Do *not* include trailing slash !! #
|
||||||
|
############################################
|
||||||
|
cache_base_dir = '/var/tmp/airtime/pypo'
|
||||||
|
bin_dir = '/usr/lib/airtime/pypo'
|
||||||
|
log_base_dir = '/var/log/airtime'
|
||||||
|
pypo_log_dir = '/var/log/airtime/pypo'
|
||||||
|
liquidsoap_log_dir = '/var/log/airtime/pypo-liquidsoap'
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# Liquidsoap settings #
|
||||||
|
############################################
|
||||||
|
ls_host = '127.0.0.1'
|
||||||
|
ls_port = '1234'
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# RabbitMQ settings #
|
||||||
|
############################################
|
||||||
|
rabbitmq_host = 'localhost'
|
||||||
|
rabbitmq_user = 'guest'
|
||||||
|
rabbitmq_password = 'guest'
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# pypo preferences #
|
||||||
|
############################################
|
||||||
|
prepare_ahead = 24 #in hours
|
||||||
|
cache_for = 24 #how long to hold the cache, in hours
|
||||||
|
|
||||||
|
# Poll interval in seconds.
|
||||||
|
#
|
||||||
|
# This will rarely need to be changed because any schedule changes are
|
||||||
|
# automatically sent to pypo immediately.
|
||||||
|
#
|
||||||
|
# This is how often the poll script downloads new schedules and files from the
|
||||||
|
# server in the event that no changes are made to the schedule.
|
||||||
|
#
|
||||||
|
poll_interval = 3600 # in seconds.
|
||||||
|
|
||||||
|
|
||||||
|
# Push interval in seconds.
|
||||||
|
#
|
||||||
|
# This is how often the push script checks whether it has something new to
|
||||||
|
# push to liquidsoap.
|
||||||
|
#
|
||||||
|
# It's hard to imagine a situation where this should be more than 1 second.
|
||||||
|
#
|
||||||
|
push_interval = 1 # in seconds
|
||||||
|
|
||||||
|
# 'pre' or 'otf'. 'pre' cues while playlist preparation
|
||||||
|
# while 'otf' (on the fly) cues while loading into ls
|
||||||
|
# (needs the post_processor patch)
|
||||||
|
cue_style = 'pre'
|
|
@ -0,0 +1,26 @@
|
||||||
|
api_client = "airtime"
|
||||||
|
|
||||||
|
# where the binary files live
|
||||||
|
bin_dir = '/usr/lib/airtime/show-recorder'
|
||||||
|
|
||||||
|
# base path to store recordered shows at
|
||||||
|
base_recorded_files = '/var/tmp/airtime/show-recorder/'
|
||||||
|
|
||||||
|
# where the logging files live
|
||||||
|
log_dir = '/var/log/airtime/show-recorder'
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# RabbitMQ settings #
|
||||||
|
############################################
|
||||||
|
rabbitmq_host = 'localhost'
|
||||||
|
rabbitmq_user = 'guest'
|
||||||
|
rabbitmq_password = 'guest'
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# Recorded Audio settings #
|
||||||
|
############################################
|
||||||
|
record_bitrate = 256
|
||||||
|
record_samplerate = 44100
|
||||||
|
record_channels = 2
|
||||||
|
record_sample_size = 16
|
||||||
|
|
|
@ -43,6 +43,7 @@ try:
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
storage_directory = apc.encode_to(response["stor"], 'utf-8')
|
storage_directory = apc.encode_to(response["stor"], 'utf-8')
|
||||||
|
watched_dirs = apc.encode_to(response["watched_dirs"], 'utf-8')
|
||||||
logger.info("Storage Directory is: %s", storage_directory)
|
logger.info("Storage Directory is: %s", storage_directory)
|
||||||
config.storage_directory = os.path.normpath(storage_directory)
|
config.storage_directory = os.path.normpath(storage_directory)
|
||||||
config.imported_directory = os.path.normpath(storage_directory + '/imported')
|
config.imported_directory = os.path.normpath(storage_directory + '/imported')
|
||||||
|
@ -77,6 +78,11 @@ try:
|
||||||
wdd = notifier.watch_directory(storage_directory)
|
wdd = notifier.watch_directory(storage_directory)
|
||||||
logger.info("Added watch to %s", storage_directory)
|
logger.info("Added watch to %s", storage_directory)
|
||||||
logger.info("wdd result %s", wdd[storage_directory])
|
logger.info("wdd result %s", wdd[storage_directory])
|
||||||
|
|
||||||
|
for dir in watched_dirs:
|
||||||
|
wdd = notifier.watch_directory(dir)
|
||||||
|
logger.info("Added watch to %s", dir)
|
||||||
|
logger.info("wdd result %s", wdd[dir])
|
||||||
|
|
||||||
notifier.loop(callback=pe.notifier_loop_callback)
|
notifier.loop(callback=pe.notifier_loop_callback)
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ class AirtimeNotifier(Notifier):
|
||||||
self.wm = watch_manager
|
self.wm = watch_manager
|
||||||
self.mask = pyinotify.ALL_EVENTS
|
self.mask = pyinotify.ALL_EVENTS
|
||||||
|
|
||||||
|
|
||||||
while not self.init_rabbit_mq():
|
while not self.init_rabbit_mq():
|
||||||
self.logger.error("Error connecting to RabbitMQ Server. Trying again in few seconds")
|
self.logger.error("Error connecting to RabbitMQ Server. Trying again in few seconds")
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
|
@ -102,6 +102,8 @@ class AirtimeProcessEvent(ProcessEvent):
|
||||||
#we don't care about moved_from events from the organize dir.
|
#we don't care about moved_from events from the organize dir.
|
||||||
if self.mmc.is_audio_file(event.name):
|
if self.mmc.is_audio_file(event.name):
|
||||||
self.cookies_IN_MOVED_FROM[event.cookie] = (event, time.time())
|
self.cookies_IN_MOVED_FROM[event.cookie] = (event, time.time())
|
||||||
|
else:
|
||||||
|
self.cookies_IN_MOVED_FROM[event.cookie] = event.pathname
|
||||||
|
|
||||||
|
|
||||||
#Some weird thing to note about this event: it seems that if a file is moved to a newly
|
#Some weird thing to note about this event: it seems that if a file is moved to a newly
|
||||||
|
@ -141,17 +143,23 @@ class AirtimeProcessEvent(ProcessEvent):
|
||||||
#When we move a directory into a watched_dir, we only get a notification that the dir was created,
|
#When we move a directory into a watched_dir, we only get a notification that the dir was created,
|
||||||
#and no additional information about files that came along with that directory.
|
#and no additional information about files that came along with that directory.
|
||||||
#need to scan the entire directory for files.
|
#need to scan the entire directory for files.
|
||||||
|
|
||||||
|
if event.cookie in self.cookies_IN_MOVED_FROM:
|
||||||
|
del self.cookies_IN_MOVED_FROM[event.cookie]
|
||||||
|
mode = self.config.MODE_MOVED
|
||||||
|
else:
|
||||||
|
mode = self.config.MODE_CREATE
|
||||||
|
|
||||||
files = self.mmc.scan_dir_for_new_files(event.pathname)
|
files = self.mmc.scan_dir_for_new_files(event.pathname)
|
||||||
if self.mmc.is_parent_directory(event.pathname, self.config.organize_directory):
|
if self.mmc.is_parent_directory(event.pathname, self.config.organize_directory):
|
||||||
for file in files:
|
for file in files:
|
||||||
self.mmc.organize_new_file(file)
|
filepath = self.mmc.organize_new_file(file)
|
||||||
|
if (filepath is not None):
|
||||||
|
self.file_events.append({'mode': mode, 'filepath': filepath})
|
||||||
else:
|
else:
|
||||||
for file in files:
|
for file in files:
|
||||||
if self.mmc.is_parent_directory(pathname, self.config.recorded_directory):
|
self.file_events.append({'mode': mode, 'filepath': file})
|
||||||
is_recorded = True
|
|
||||||
else :
|
|
||||||
is_recorded = False
|
|
||||||
self.file_events.append({'mode': self.config.MODE_CREATE, 'filepath': file, 'is_recorded_show': is_recorded})
|
|
||||||
|
|
||||||
def process_IN_DELETE(self, event):
|
def process_IN_DELETE(self, event):
|
||||||
self.logger.info("process_IN_DELETE: %s", event)
|
self.logger.info("process_IN_DELETE: %s", event)
|
||||||
|
|
Loading…
Reference in New Issue