Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
c5b1e23486
31 changed files with 153 additions and 55 deletions
|
@ -603,7 +603,6 @@ class ApiController extends Zend_Controller_Action
|
|||
$filepath = $md['MDATA_KEY_FILEPATH'];
|
||||
$filepath = str_replace("\\", "", $filepath);
|
||||
$file->setFilePath($filepath);
|
||||
//$file->setMetadata($md);
|
||||
}
|
||||
}
|
||||
else if ($mode == "delete") {
|
||||
|
|
|
@ -134,7 +134,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
|||
'readonly' => true,
|
||||
'rows' => 5,
|
||||
'cols' => 61,
|
||||
'value' => Application_Model_Preference::GetSystemInfo(),
|
||||
'value' => Application_Model_Preference::GetSystemInfo(false, true),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
|
|
|
@ -139,7 +139,7 @@ class Application_Form_SupportSettings extends Zend_Form
|
|||
'readonly' => true,
|
||||
'cols' => 61,
|
||||
'rows' => 5,
|
||||
'value' => Application_Model_Preference::GetSystemInfo(),
|
||||
'value' => Application_Model_Preference::GetSystemInfo(false, true),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
|
|
|
@ -32,10 +32,18 @@ class Application_Model_LiveLog
|
|||
$duration = $start->diff($end);
|
||||
$duration = $duration->format("%H:%i:%s");
|
||||
$intervals = explode(":", $duration);
|
||||
for ($i = 0; $i < sizeof($intervals); $i++) {
|
||||
if (!isset($intervals[$i])) {
|
||||
$intervals[$i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Trim milliseconds (DateInterval does not support)
|
||||
$sec = explode(".", $intervals[2]);
|
||||
$intervals[2] = $sec[0];
|
||||
|
||||
if (isset($sec[0])) {
|
||||
$intervals[2] = $sec[0];
|
||||
}
|
||||
|
||||
$seconds += $intervals[2];
|
||||
if ($seconds / 60 >= 1) {
|
||||
$minutes += 1;
|
||||
|
@ -59,9 +67,12 @@ class Application_Model_LiveLog
|
|||
}
|
||||
//Trim milliseconds
|
||||
$seconds = explode(".", $seconds);
|
||||
$minutes = (double)(($hours*60)+$minutes . "." . $seconds[0]);
|
||||
//$duration = new DateInterval("PT" . $minutes . "M" . $seconds[0] ."S");
|
||||
//return $duration->format("%i.%s");
|
||||
if (isset($seconds[0])) {
|
||||
$minutes = (double)(($hours*60)+$minutes . "." . $seconds[0]);
|
||||
}
|
||||
else {
|
||||
$minutes = (double)(($hours*60)+$minutes);
|
||||
}
|
||||
return $minutes;
|
||||
} catch (Exception $e) {
|
||||
header('HTTP/1.0 503 Service Unavailable');
|
||||
|
@ -70,7 +81,7 @@ class Application_Model_LiveLog
|
|||
}
|
||||
}
|
||||
|
||||
public static function GetScheduledDuration($p_keepData = false)
|
||||
public static function GetScheduledDuration($p_keepData=false)
|
||||
{
|
||||
try {
|
||||
$con = Propel::getConnection();
|
||||
|
@ -118,11 +129,21 @@ class Application_Model_LiveLog
|
|||
$clip_length = $track['clip_length'];
|
||||
//Convert clip_length into seconds
|
||||
$clip_length_intervals = explode(":", $clip_length);
|
||||
for ($i = 0; $i < sizeof($clip_length_intervals); $i++) {
|
||||
if (!isset($clip_length_intervals[$i])) {
|
||||
$clip_length_intervals[$i] = 0;
|
||||
}
|
||||
}
|
||||
$clip_length_seconds = $clip_length_intervals[0]*3600 + $clip_length_intervals[1]*60 + $clip_length_intervals[2];
|
||||
|
||||
$extra_time = $extra_time->format("%H:%i:%s");
|
||||
//Convert extra_time into seconds;
|
||||
$extra_time_intervals = explode(":", $extra_time);
|
||||
for ($i = 0; $i < sizeof($extra_time_intervals); $i++) {
|
||||
if (!isset($extra_time_intervals[$i])) {
|
||||
$extra_time_intervals[$i] = 0;
|
||||
}
|
||||
}
|
||||
$extra_time_seconds = $extra_time_intervals[0]*3600 + $extra_time_intervals[1]*60 + $extra_time_intervals[2];
|
||||
|
||||
$clip_length_seconds -= $extra_time_seconds;
|
||||
|
@ -152,9 +173,16 @@ class Application_Model_LiveLog
|
|||
}
|
||||
|
||||
$intervals = explode(":", $clip_length);
|
||||
for ($i = 0; $i < sizeof($intervals); $i++) {
|
||||
if (!isset($intervals[$i])) {
|
||||
$intervals[$i] = 0;
|
||||
}
|
||||
}
|
||||
// Trim milliseconds (DateInteral does not support)
|
||||
$sec = explode(".", $intervals[2]);
|
||||
$intervals[2] = $sec[0];
|
||||
if (isset($sec[0])) {
|
||||
$intervals[2] = $sec[0];
|
||||
}
|
||||
|
||||
$seconds += $intervals[2];
|
||||
if ($seconds / 60 >= 1) {
|
||||
|
@ -181,9 +209,12 @@ class Application_Model_LiveLog
|
|||
|
||||
|
||||
$seconds = explode(".", $seconds);
|
||||
$minutes = (double)(($hours*60)+$minutes . "." . $seconds[0]);
|
||||
//$duration = new DateInterval("PT". $minutes . "M" . $seconds[0] ."S");
|
||||
//return $duration->format("%i.%s");
|
||||
if (isset($seconds[0])) {
|
||||
$minutes = (double)(($hours*60)+$minutes . "." . $seconds[0]);
|
||||
}
|
||||
else {
|
||||
$minutes = (double)(($hours*60)+$minutes);
|
||||
}
|
||||
return $minutes;
|
||||
} catch (Exception $e) {
|
||||
header('HTTP/1.0 503 Service Unavailable');
|
||||
|
|
|
@ -400,7 +400,6 @@ class Application_Model_Preference
|
|||
public static function GetSystemInfo($returnArray=false, $p_testing=false)
|
||||
{
|
||||
exec('/usr/bin/airtime-check-system --no-color', $output);
|
||||
|
||||
$output = preg_replace('/\s+/', ' ', $output);
|
||||
|
||||
$systemInfoArray = array();
|
||||
|
@ -409,7 +408,12 @@ class Application_Model_Preference
|
|||
if(isset($info[1])){
|
||||
$key = str_replace(' ', '_', trim($info[0]));
|
||||
$key = strtoupper($key);
|
||||
$systemInfoArray[$key] = $info[1];
|
||||
if ($key == 'WEB_SERVER' || $key == 'CPU' || $key == 'OS' || $key == 'TOTAL_RAM' ||
|
||||
$key == 'FREE_RAM' || $key == 'AIRTIME_VERSION' || $key == 'KERNAL_VERSION' ||
|
||||
$key == 'MACHINE_ARCHITECTURE' || $key == 'TOTAL_MEMORY_MBYTES' || $key == 'TOTAL_SWAP_MBYTES' ||
|
||||
$key == 'PLAYOUT_ENGINE_CPU_PERC' ) {
|
||||
$systemInfoArray[$key] = $info[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -461,26 +465,24 @@ class Application_Model_Preference
|
|||
|
||||
$outputString = "\n";
|
||||
foreach($outputArray as $key => $out){
|
||||
if($key == 'SAAS' && ($out != '' || $out != 'disabled')){
|
||||
if($key == 'TRIAL_END_DATE' && ($out != '' || $out != 'NULL')){
|
||||
continue;
|
||||
}
|
||||
if($out != '' || is_numeric($out)){
|
||||
if($key == "STREAM_INFO"){
|
||||
$outputString .= $key." :\n";
|
||||
foreach($out as $s_info){
|
||||
foreach($s_info as $k => $v){
|
||||
$outputString .= "\t".strtoupper($k)." : ".$v."\n";
|
||||
}
|
||||
if($key == "STREAM_INFO"){
|
||||
$outputString .= $key." :\n";
|
||||
foreach($out as $s_info){
|
||||
foreach($s_info as $k => $v){
|
||||
$outputString .= "\t".strtoupper($k)." : ".$v."\n";
|
||||
}
|
||||
}else if ($key == "SOUNDCLOUD_ENABLED") {
|
||||
if ($out) {
|
||||
$outputString .= $key." : TRUE\n";
|
||||
} else if (!$out) {
|
||||
$outputString .= $key." : FALSE\n";
|
||||
}
|
||||
}else{
|
||||
$outputString .= $key.' : '.$out."\n";
|
||||
}
|
||||
}else if ($key == "SOUNDCLOUD_ENABLED") {
|
||||
if ($out) {
|
||||
$outputString .= $key." : TRUE\n";
|
||||
} else if (!$out) {
|
||||
$outputString .= $key." : FALSE\n";
|
||||
}
|
||||
}else{
|
||||
$outputString .= $key.' : '.$out."\n";
|
||||
}
|
||||
}
|
||||
if($returnArray){
|
||||
|
|
|
@ -82,7 +82,7 @@ class Application_Model_RabbitMq
|
|||
|
||||
$temp['event_type'] = $event_type;
|
||||
$temp['server_timezone'] = Application_Model_Preference::GetTimezone();
|
||||
if($event_type = "update_recorder_schedule"){
|
||||
if($event_type == "update_recorder_schedule"){
|
||||
$temp['shows'] = Application_Model_Show::getShows($now, $end_timestamp, $excludeInstance=NULL, $onlyRecord=TRUE);
|
||||
}
|
||||
$data = json_encode($temp);
|
||||
|
|
|
@ -651,15 +651,16 @@ class Application_Model_Scheduler {
|
|||
}
|
||||
|
||||
$this->removeItems($remove, false);
|
||||
}
|
||||
|
||||
$instance->setDbEnds($this->nowDT);
|
||||
$instance->save($this->con);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$instance->delete($this->con);
|
||||
}
|
||||
|
||||
$rebroadcasts = $instance->getCcShowInstancessRelatedByDbId(null, $this->con);
|
||||
$rebroadcasts->delete($this->con);
|
||||
}
|
||||
|
||||
$instance->setDbEnds($this->nowDT);
|
||||
$instance->save($this->con);
|
||||
|
||||
$this->con->commit();
|
||||
|
||||
if ($instance->getDbRecord()) {
|
||||
|
|
|
@ -1753,8 +1753,7 @@ class Application_Model_Show {
|
|||
." AND modified_instance != TRUE"
|
||||
." ORDER BY si.starts";
|
||||
|
||||
// Convert back to local timezone
|
||||
$rows = $con->query($sql)->fetchAll();
|
||||
$rows = $con->query($sql)->fetchAll(PDO::FETCH_ASSOC);
|
||||
$numberOfRows = count($rows);
|
||||
|
||||
$results['previousShow'] = array();
|
||||
|
@ -1771,6 +1770,7 @@ class Application_Model_Show {
|
|||
"id"=>$rows[$i-1]['id'],
|
||||
"instance_id"=>$rows[$i-1]['instance_id'],
|
||||
"name"=>$rows[$i-1]['name'],
|
||||
"url"=>$rows[$i-1]['url'],
|
||||
"start_timestamp"=>$rows[$i-1]['start_timestamp'],
|
||||
"end_timestamp"=>$rows[$i-1]['end_timestamp'],
|
||||
"starts"=>$rows[$i-1]['starts'],
|
||||
|
@ -1784,6 +1784,7 @@ class Application_Model_Show {
|
|||
"id"=>$rows[$i+1]['id'],
|
||||
"instance_id"=>$rows[$i+1]['instance_id'],
|
||||
"name"=>$rows[$i+1]['name'],
|
||||
"url"=>$rows[$i+1]['url'],
|
||||
"start_timestamp"=>$rows[$i+1]['start_timestamp'],
|
||||
"end_timestamp"=>$rows[$i+1]['end_timestamp'],
|
||||
"starts"=>$rows[$i+1]['starts'],
|
||||
|
@ -1802,6 +1803,7 @@ class Application_Model_Show {
|
|||
"id"=>$rows[$i]['id'],
|
||||
"instance_id"=>$rows[$i]['instance_id'],
|
||||
"name"=>$rows[$i]['name'],
|
||||
"url"=>$rows[$i]['url'],
|
||||
"start_timestamp"=>$rows[$i]['start_timestamp'],
|
||||
"end_timestamp"=>$rows[$i]['end_timestamp'],
|
||||
"starts"=>$rows[$i]['starts'],
|
||||
|
|
|
@ -543,9 +543,6 @@ class Application_Model_ShowInstance {
|
|||
}
|
||||
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
if($recording){
|
||||
Application_Model_RabbitMq::SendMessageToShowRecorder("cancel_recording");
|
||||
}
|
||||
}
|
||||
|
||||
public function setRecordedFile($file_id)
|
||||
|
@ -577,7 +574,7 @@ class Application_Model_ShowInstance {
|
|||
{
|
||||
$time = $this->_showInstance->getDbTimeFilled();
|
||||
|
||||
if ($time != "00:00:00") {
|
||||
if ($time != "00:00:00" && $time != null && strcmp($time, '')!=0) {
|
||||
$time_arr = explode(".", $time);
|
||||
if (count($time_arr) > 1) {
|
||||
$time_arr[1] = "." . $time_arr[1];
|
||||
|
|
|
@ -92,7 +92,9 @@ class Application_Model_StoredFile {
|
|||
else {
|
||||
$dbMd = array();
|
||||
foreach ($p_md as $mdConst => $mdValue) {
|
||||
$dbMd[constant($mdConst)] = $mdValue;
|
||||
if (defined($mdConst)){
|
||||
$dbMd[constant($mdConst)] = $mdValue;
|
||||
}
|
||||
}
|
||||
$this->setDbColMetadata($dbMd);
|
||||
}
|
||||
|
@ -703,7 +705,7 @@ Logging::log("getting media! - 2");
|
|||
$row['image'] = '<img title="Track preview" src="/css/images/icon_audioclip.png">';
|
||||
}
|
||||
else {
|
||||
$row['image'] = '<img src="/css/images/icon_playlist.png">';
|
||||
$row['image'] = '<img title="Playlist preview" src="/css/images/icon_playlist.png">';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ function confirmCancelShow(show_instance_id){
|
|||
}
|
||||
|
||||
function confirmCancelRecordedShow(show_instance_id){
|
||||
if (confirm('Erase current show and stop recording?')) {
|
||||
if (confirm('Stop recording current show?')) {
|
||||
var url = "/Schedule/cancel-current-show";
|
||||
$.ajax({
|
||||
url: url,
|
||||
|
|
|
@ -849,7 +849,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
data = $tr.data("aData");
|
||||
|
||||
if (data.record === true) {
|
||||
msg = 'Erase current show and stop recording?';
|
||||
msg = 'Stop recording current show?';
|
||||
}
|
||||
|
||||
if (confirm(msg)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue