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

@ -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(){