Merge branch '2.0.x' of dev.sourcefabric.org:airtime into 2.0.x

This commit is contained in:
Daniel 2012-02-17 16:49:44 -05:00
commit 5dd94ce12c
205 changed files with 70643 additions and 603 deletions

View file

@ -1,7 +1,6 @@
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"

View file

@ -219,8 +219,6 @@ class PreferenceController extends Zend_Controller_Action
for($i=1;$i<=$num_of_stream;$i++){
Application_Model_StreamSetting::setLiquidsoapError($i, "waiting");
}
// this goes into cc_pref table
Application_Model_Preference::SetStreamLabelFormat($values['streamFormat']);
// store stream update timestamp
Application_Model_Preference::SetStreamUpdateTimestamp();
Application_Model_RabbitMq::SendMessageToPypo("update_stream_setting", $data);

View file

@ -4,6 +4,8 @@ class SystemstatusController extends Zend_Controller_Action
{
public function init()
{
global $CC_CONFIG;
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();

View file

@ -102,7 +102,6 @@ class Application_Model_Preference
public static function SetHeadTitle($title, $view=null){
self::SetValue("station_name", $title);
Application_Model_RabbitMq::PushSchedule();
// in case this is called from airtime-saas script
if($view !== null){
@ -111,6 +110,11 @@ class Application_Model_Preference
$view->headTitle()->exchangeArray(array()); //clear headTitle ArrayObject
$view->headTitle(self::GetHeadTitle());
}
$eventType = "update_station_name";
$md = array("station_name"=>$title);
Application_Model_RabbitMq::SendMessageToPypo($eventType, $md);
}
/**
@ -153,7 +157,11 @@ class Application_Model_Preference
public static function SetStreamLabelFormat($type){
self::SetValue("stream_label_format", $type);
Application_Model_RabbitMq::PushSchedule();
$eventType = "update_stream_format";
$md = array("stream_format"=>$type);
Application_Model_RabbitMq::SendMessageToPypo($eventType, $md);
}
public static function GetStreamLabelFormat(){
@ -421,7 +429,7 @@ class Application_Model_Preference
}
public static function GetInstallMethod(){
$easy_install = file_exists('/usr/bin/airtime-easy-install');
$easy_install = file_exists('/usr/bin/airtime-easy-setup');
$debian_install = file_exists('/var/lib/dpkg/info/airtime.config');
if($debian_install){
if($easy_install){

View file

@ -1396,7 +1396,7 @@ class Application_Model_Show {
Application_Model_Preference::SetShowsPopulatedUntil($end_timestamp);
}
$sql = "SELECT starts, ends, record, rebroadcast, instance_id, show_id, name, description,
$sql = "SELECT starts, ends, record, rebroadcast, instance_id, show_id, name,
color, background_color, file_id, cc_show_instances.id AS instance_id
FROM cc_show_instances
LEFT JOIN cc_show ON cc_show.id = cc_show_instances.show_id
@ -1536,7 +1536,6 @@ class Application_Model_Show {
$event["start"] = $startDateTime->format("Y-m-d H:i:s");
$event["end"] = $endDateTime->format("Y-m-d H:i:s");
$event["allDay"] = false;
$event["description"] = $show["description"];
$event["showId"] = $show["show_id"];
$event["record"] = intval($show["record"]);
$event["rebroadcast"] = intval($show["rebroadcast"]);

View file

@ -83,8 +83,12 @@ class Application_Model_StreamSetting {
$CC_DBC->query($sql);
} else if ($key == "output_sound_device_type") {
$sql = "UPDATE cc_stream_setting SET value='$d' WHERE keyname='$key'";
$CC_DBC->query($sql);
} else {
$CC_DBC->query($sql);
} else if ($key == "streamFormat"){
// this goes into cc_pref table
Logging::log("Insert stream label format $d");
Application_Model_Preference::SetStreamLabelFormat($d);
} else if (is_array($d)) {
$temp = explode('_', $key);
$prefix = $temp[0];
foreach ($d as $k=>$v) {
@ -96,6 +100,8 @@ class Application_Model_StreamSetting {
$sql = "UPDATE cc_stream_setting SET value='$v' WHERE keyname='$keyname'";
$CC_DBC->query($sql);
}
} else {
Logging::log("Warning unexpected value: ".$key);
}
}
}

View file

@ -120,23 +120,31 @@ class Application_Model_Systemstatus
public static function GetPypoStatus(){
$component = CcServiceRegisterQuery::create()->findOneByDbName("pypo");
$ip = $component->getDbIp();
$docRoot = self::GetMonitStatus($ip);
$data = self::ExtractServiceInformation($docRoot, "airtime-playout");
if (is_null($component)){
return null;
} else {
$ip = $component->getDbIp();
$docRoot = self::GetMonitStatus($ip);
$data = self::ExtractServiceInformation($docRoot, "airtime-playout");
return $data;
return $data;
}
}
public static function GetLiquidsoapStatus(){
$component = CcServiceRegisterQuery::create()->findOneByDbName("pypo");
$ip = $component->getDbIp();
$docRoot = self::GetMonitStatus($ip);
$data = self::ExtractServiceInformation($docRoot, "airtime-liquidsoap");
if (is_null($component)){
return null;
} else {
$ip = $component->getDbIp();
$docRoot = self::GetMonitStatus($ip);
$data = self::ExtractServiceInformation($docRoot, "airtime-liquidsoap");
return $data;
return $data;
}
}
public static function GetShowRecorderStatus(){

View file

@ -14,8 +14,8 @@ defined('APPLICATION_ENV')
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
realpath(APPLICATION_PATH . '/../library')
)));
//Propel classes.

View file

@ -0,0 +1,6 @@
<?php
/* The purpose of this file is get PHP to clear its cache regarding the
* filesystem layout. See this ticket http://dev.sourcefabric.org/browse/CC-3320 */
clearstatcache(true);

View file

@ -30,9 +30,11 @@ function generatePartitions(partitions){
var tr = $(row);
lastElement.after(tr);
var watched_dirs_ul = $('#watched-dir-list-'+i);
for (var j=0; j<partitions[i].dirs.length; j++){
watched_dirs_ul.append('<li>'+partitions[i].dirs[j]+'</li>');
if (partitions[i].dirs){
var watched_dirs_ul = $('#watched-dir-list-'+i);
for (var j=0; j<partitions[i].dirs.length; j++){
watched_dirs_ul.append('<li>'+partitions[i].dirs[j]+'</li>');
}
}
lastElement = tr;
}