Merge branch '2.2.x-saas' of dev.sourcefabric.org:airtime into 2.2.x-saas
This commit is contained in:
commit
41cb6b2b0b
16 changed files with 124 additions and 48 deletions
|
@ -95,7 +95,8 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||
|
||||
if (strpos($_SERVER['REQUEST_URI'], $baseUrl.'/Dashboard/stream-player') === false
|
||||
&& strpos($_SERVER['REQUEST_URI'], $baseUrl.'/audiopreview/audio-preview') === false
|
||||
&& strpos($_SERVER['REQUEST_URI'], $baseUrl.'/audiopreview/playlist-preview') === false) {
|
||||
&& strpos($_SERVER['REQUEST_URI'], $baseUrl.'/audiopreview/playlist-preview') === false
|
||||
&& strpos($_SERVER['REQUEST_URI'], $baseUrl.'/audiopreview/block-preview') === false) {
|
||||
$client_id = Application_Model_Preference::GetClientId();
|
||||
$view->headScript()->appendScript("var livechat_client_id = '$client_id';");
|
||||
$view->headScript()->appendFile($baseUrl . '/js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
|
|
@ -686,6 +686,22 @@ class ApiController extends Zend_Controller_Action
|
|||
Logging::info("Registered Component: ".$component."@".$remoteAddr);
|
||||
|
||||
Application_Model_ServiceRegister::Register($component, $remoteAddr);
|
||||
|
||||
//send ip, subdomain
|
||||
if (Application_Model_Preference::GetPlanLevel() != 'disabled'){
|
||||
if ($component == "pypo"){
|
||||
$split = explode('.', $_SERVER['SERVER_NAME']);
|
||||
if (count($split) > 0){
|
||||
$subDomain = $split[0];
|
||||
|
||||
$md = array();
|
||||
$md["sub_domain"] = $subDomain;
|
||||
$md["pypo_ip"] = $remoteAddr;
|
||||
|
||||
Application_Model_RabbitMq::SendMessageToHaproxyConfigDaemon($md);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function updateLiquidsoapStatusAction()
|
||||
|
|
|
@ -53,7 +53,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
Application_Model_Preference::SetMailServerRequiresAuth($values["preferences_email_server"]["msRequiresAuth"]);
|
||||
}
|
||||
|
||||
Application_Model_Preference::SetAutoUploadRecordedShowToSoundcloud($values["preferences_soundcloud"]["UseSoundCloud"]);
|
||||
Application_Model_Preference::SetUploadToSoundcloudOption($values["preferences_soundcloud"]["UploadToSoundcloudOption"]);
|
||||
Application_Model_Preference::SetSoundCloudDownloadbleOption($values["preferences_soundcloud"]["SoundCloudDownloadbleOption"]);
|
||||
Application_Model_Preference::SetSoundCloudUser($values["preferences_soundcloud"]["SoundCloudUser"]);
|
||||
|
|
|
@ -18,7 +18,7 @@ class SystemstatusController extends Zend_Controller_Action
|
|||
"pypo"=>Application_Model_Systemstatus::GetPypoStatus(),
|
||||
"liquidsoap"=>Application_Model_Systemstatus::GetLiquidsoapStatus(),
|
||||
"media-monitor"=>Application_Model_Systemstatus::GetMediaMonitorStatus(),
|
||||
"rabbitmq-server"=>Application_Model_Systemstatus::GetRabbitMqStatus()
|
||||
//"rabbitmq-server"=>Application_Model_Systemstatus::GetRabbitMqStatus()
|
||||
);
|
||||
|
||||
$partitions = Application_Model_Systemstatus::GetDiskInfo();
|
||||
|
|
|
@ -11,16 +11,6 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
|
|||
array('ViewScript', array('viewScript' => 'form/preferences_soundcloud.phtml'))
|
||||
));
|
||||
|
||||
//enable soundcloud uploads
|
||||
$this->addElement('checkbox', 'UseSoundCloud', array(
|
||||
'label' => 'Automatically Upload Recorded Shows',
|
||||
'required' => false,
|
||||
'value' => Application_Model_Preference::GetAutoUploadRecordedShowToSoundcloud(),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
//enable soundcloud uploads option
|
||||
$this->addElement('checkbox', 'UploadToSoundcloudOption', array(
|
||||
'label' => 'Enable SoundCloud Upload',
|
||||
|
|
|
@ -71,4 +71,46 @@ class Application_Model_RabbitMq
|
|||
|
||||
self::sendMessage($exchange, $data);
|
||||
}
|
||||
|
||||
public static function SendMessageToHaproxyConfigDaemon($md){
|
||||
$config = parse_ini_file("/etc/airtime-saas/rabbitmq.ini", true);
|
||||
$conn = new AMQPConnection($config["rabbitmq"]["host"],
|
||||
$config["rabbitmq"]["port"],
|
||||
$config["rabbitmq"]["user"],
|
||||
$config["rabbitmq"]["password"],
|
||||
$config["rabbitmq"]["vhost"]);
|
||||
|
||||
$exchange = $config["rabbitmq"]["queue"];
|
||||
$queue = $config["rabbitmq"]["queue"];
|
||||
|
||||
$ch = $conn->channel();
|
||||
|
||||
|
||||
/*
|
||||
name: $queue
|
||||
passive: false
|
||||
durable: true // the queue will survive server restarts
|
||||
exclusive: false // the queue can be accessed in other channels
|
||||
auto_delete: false //the queue won't be deleted once the channel is closed.
|
||||
*/
|
||||
$ch->queue_declare($queue, false, true, false, false);
|
||||
|
||||
/*
|
||||
name: $exchange
|
||||
type: direct
|
||||
passive: false
|
||||
durable: true // the exchange will survive server restarts
|
||||
auto_delete: false //the exchange won't be deleted once the channel is closed.
|
||||
*/
|
||||
|
||||
$ch->exchange_declare($exchange, 'direct', false, true, false);
|
||||
$ch->queue_bind($queue, $exchange);
|
||||
|
||||
$data = json_encode($md).PHP_EOL;
|
||||
$msg = new AMQPMessage($data, array('content_type' => 'application/json'));
|
||||
|
||||
$ch->basic_publish($msg, $exchange);
|
||||
$ch->close();
|
||||
$conn->close();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -263,6 +263,15 @@ SQL;
|
|||
global $CC_CONFIG;
|
||||
$con = Propel::getConnection();
|
||||
|
||||
$p_start_str = $p_start->format("Y-m-d H:i:s");
|
||||
$p_end_str = $p_end->format("Y-m-d H:i:s");
|
||||
|
||||
|
||||
//We need to search 24 hours before and after the show times so that that we
|
||||
//capture all of the show's contents.
|
||||
$p_track_start= $p_start->sub(new DateInterval("PT24H"))->format("Y-m-d H:i:s");
|
||||
$p_track_end = $p_end->add(new DateInterval("PT24H"))->format("Y-m-d H:i:s");
|
||||
|
||||
$templateSql = <<<SQL
|
||||
SELECT DISTINCT sched.starts AS sched_starts,
|
||||
sched.ends AS sched_ends,
|
||||
|
@ -288,12 +297,12 @@ SQL;
|
|||
$filesJoin = <<<SQL
|
||||
cc_schedule AS sched
|
||||
JOIN cc_files AS ft ON (sched.file_id = ft.id
|
||||
AND ((sched.starts >= '{$p_start}'
|
||||
AND sched.starts < '{$p_end}')
|
||||
OR (sched.ends > '{$p_start}'
|
||||
AND sched.ends <= '{$p_end}')
|
||||
OR (sched.starts <= '{$p_start}'
|
||||
AND sched.ends >= '{$p_end}'))
|
||||
AND ((sched.starts >= '{$p_track_start}'
|
||||
AND sched.starts < '{$p_track_end}')
|
||||
OR (sched.ends > '{$p_track_start}'
|
||||
AND sched.ends <= '{$p_track_end}')
|
||||
OR (sched.starts <= '{$p_track_start}'
|
||||
AND sched.ends >= '{$p_track_end}'))
|
||||
)
|
||||
SQL;
|
||||
|
||||
|
@ -315,12 +324,12 @@ SQL;
|
|||
$streamJoin = <<<SQL
|
||||
cc_schedule AS sched
|
||||
JOIN cc_webstream AS ws ON (sched.stream_id = ws.id
|
||||
AND ((sched.starts >= '{$p_start}'
|
||||
AND sched.starts < '{$p_end}')
|
||||
OR (sched.ends > '{$p_start}'
|
||||
AND sched.ends <= '{$p_end}')
|
||||
OR (sched.starts <= '{$p_start}'
|
||||
AND sched.ends >= '{$p_end}'))
|
||||
AND ((sched.starts >= '{$p_track_start}'
|
||||
AND sched.starts < '{$p_track_end}')
|
||||
OR (sched.ends > '{$p_track_start}'
|
||||
AND sched.ends <= '{$p_track_end}')
|
||||
OR (sched.starts <= '{$p_track_start}'
|
||||
AND sched.ends >= '{$p_track_end}'))
|
||||
)
|
||||
LEFT JOIN cc_subjs AS sub ON (ws.creator_id = sub.id)
|
||||
SQL;
|
||||
|
@ -358,12 +367,12 @@ SELECT showt.name AS show_name,
|
|||
JOIN cc_show AS showt ON (showt.id = si.show_id)
|
||||
WHERE si.modified_instance = FALSE
|
||||
$showPredicate
|
||||
AND ((si.starts >= '{$p_start}'
|
||||
AND si.starts < '{$p_end}')
|
||||
OR (si.ends > '{$p_start}'
|
||||
AND si.ends <= '{$p_end}')
|
||||
OR (si.starts <= '{$p_start}'
|
||||
AND si.ends >= '{$p_end}'))
|
||||
AND ((si.starts >= '{$p_start_str}'
|
||||
AND si.starts < '{$p_end_str}')
|
||||
OR (si.ends > '{$p_start_str}'
|
||||
AND si.ends <= '{$p_end_str}')
|
||||
OR (si.starts <= '{$p_start_str}'
|
||||
AND si.ends >= '{$p_end_str}'))
|
||||
ORDER BY si_starts,
|
||||
sched_starts;
|
||||
SQL;
|
||||
|
|
|
@ -423,8 +423,7 @@ class Application_Model_ShowBuilder
|
|||
}
|
||||
|
||||
$scheduled_items = Application_Model_Schedule::GetScheduleDetailItems(
|
||||
$this->startDT->format("Y-m-d H:i:s"), $this->endDT->format(
|
||||
"Y-m-d H:i:s"), $shows);
|
||||
$this->startDT, $this->endDT, $shows);
|
||||
|
||||
for ($i = 0, $rows = count($scheduled_items); $i < $rows; $i++) {
|
||||
|
||||
|
|
|
@ -329,14 +329,24 @@ class Application_Model_User
|
|||
$res = Application_Model_Datatables::findEntries($con, $displayColumns, $fromTable, $datatables);
|
||||
|
||||
// mark record which is for the current user
|
||||
foreach ($res['aaData'] as &$record) {
|
||||
foreach($res['aaData'] as $key => &$record){
|
||||
if ($record['login'] == $username) {
|
||||
$record['delete'] = "self";
|
||||
} else {
|
||||
$record['delete'] = "";
|
||||
}
|
||||
|
||||
if($record['login'] == 'sourcefabric_admin'){
|
||||
//arrays in PHP are basically associative arrays that can be iterated in order.
|
||||
//Deleting an earlier element does not change the keys of elements that come after it. --MK
|
||||
unset($res['aaData'][$key]);
|
||||
$res['iTotalDisplayRecords']--;
|
||||
$res['iTotalRecords']--;
|
||||
}
|
||||
}
|
||||
|
||||
$res['aaData'] = array_values($res['aaData']);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,19 +13,6 @@
|
|||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dd id="UseSoundCloud-element" class="block-display" style="padding-left:20px; margin:6px 0 10px 0">
|
||||
<label class="optional" for="UseSoundCloud">
|
||||
<?php echo $this->element->getElement('UseSoundCloud') ?>
|
||||
<strong><?php echo $this->element->getElement('UseSoundCloud')->getLabel() ?></strong>
|
||||
</label>
|
||||
<?php if($this->element->getElement('UseSoundCloud')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('UseSoundCloud')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dd id="SoundCloudDownloadbleOption-element" class="block-display" style="padding-left:20px; margin:6px 0 10px 0">
|
||||
<label class="optional" for="SoundCloudDownloadbleOption">
|
||||
<?php echo $this->element->getElement('SoundCloudDownloadbleOption') ?>
|
||||
|
|
11
changelog
11
changelog
|
@ -1,3 +1,14 @@
|
|||
2.2.0 - October 25th, 2012
|
||||
* New features
|
||||
* Smart Playlists
|
||||
* Webstream rebroadcasts
|
||||
* Replaygain support
|
||||
* FLAC + WAV support (AAC if you compile your own Liquidsoap)
|
||||
* Huge performance increase on library import
|
||||
* User ownership of files
|
||||
* Stereo/mono streams
|
||||
* Rescan watched folders button (useful for network drives where keeping in sync is more difficult)
|
||||
|
||||
2.1.3 - July 4th, 2012
|
||||
* Changes
|
||||
* Clarify inputs and output labels under stream settings
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import time
|
||||
import media.monitor.pure as mmp
|
||||
import media.monitor.owners as owners
|
||||
from media.monitor.handler import ReportHandler
|
||||
|
@ -72,9 +72,13 @@ class Organizer(ReportHandler,Loggable):
|
|||
directory=d)
|
||||
return cb
|
||||
|
||||
time.sleep(0.05)
|
||||
|
||||
mmp.magic_move(event.path, new_path,
|
||||
after_dir_make=new_dir_watch(dirname(new_path)))
|
||||
|
||||
time.sleep(0.05)
|
||||
|
||||
# The reason we need to go around saving the owner in this ass
|
||||
# backwards way is bewcause we are unable to encode the owner id
|
||||
# into the file itself so that the StoreWatchListener listener can
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
AirtimeCheck::ExitIfNotRoot();
|
||||
|
||||
date_default_timezone_set("UTC");
|
||||
|
||||
$sapi_type = php_sapi_name();
|
||||
|
||||
$showColor = !in_array("--no-color", $argv);
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
exitIfNotRoot();
|
||||
|
||||
date_default_timezone_set("UTC");
|
||||
|
||||
$airtimeIni = getAirtimeConf();
|
||||
$airtime_base_dir = $airtimeIni['general']['airtime_dir'];
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
exitIfNotRoot();
|
||||
|
||||
date_default_timezone_set("UTC");
|
||||
|
||||
$values = parse_ini_file('/etc/airtime/airtime.conf', true);
|
||||
|
||||
// Name of the web server user
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<?php
|
||||
date_default_timezone_set("UTC");
|
||||
|
||||
$values = parse_ini_file('/etc/airtime/airtime.conf', true);
|
||||
|
||||
// Name of the web server user
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue