Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
75d6b509ea
4 changed files with 42 additions and 43 deletions
|
@ -872,8 +872,6 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->view->error = $e->getMessage();
|
$this->view->error = $e->getMessage();
|
||||||
Logging::info($e->getMessage());
|
Logging::info($e->getMessage());
|
||||||
Logging::info("{$e->getFile()}");
|
|
||||||
Logging::info("{$e->getLine()}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -248,11 +248,8 @@ class ShowbuilderController extends Zend_Controller_Action
|
||||||
|
|
||||||
//only send the schedule back if updates have been made.
|
//only send the schedule back if updates have been made.
|
||||||
// -1 default will always call the schedule to be sent back if no timestamp is defined.
|
// -1 default will always call the schedule to be sent back if no timestamp is defined.
|
||||||
if ($showBuilder->hasBeenUpdatedSince($timestamp, $instances)) {
|
$this->view->update = $showBuilder->hasBeenUpdatedSince(
|
||||||
$this->view->update = true;
|
$timestamp, $instances);
|
||||||
} else {
|
|
||||||
$this->view->update = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function builderFeedAction()
|
public function builderFeedAction()
|
||||||
|
@ -290,13 +287,9 @@ class ShowbuilderController extends Zend_Controller_Action
|
||||||
} catch (OutDatedScheduleException $e) {
|
} catch (OutDatedScheduleException $e) {
|
||||||
$this->view->error = $e->getMessage();
|
$this->view->error = $e->getMessage();
|
||||||
Logging::info($e->getMessage());
|
Logging::info($e->getMessage());
|
||||||
Logging::info("{$e->getFile()}");
|
|
||||||
Logging::info("{$e->getLine()}");
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->view->error = $e->getMessage();
|
$this->view->error = $e->getMessage();
|
||||||
Logging::info($e->getMessage());
|
Logging::info($e->getMessage());
|
||||||
Logging::info("{$e->getFile()}");
|
|
||||||
Logging::info("{$e->getLine()}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -198,8 +198,6 @@ class Application_Model_ShowBuilder
|
||||||
$row["record"] = true;
|
$row["record"] = true;
|
||||||
|
|
||||||
if (Application_Model_Preference::GetUploadToSoundcloudOption()) {
|
if (Application_Model_Preference::GetUploadToSoundcloudOption()) {
|
||||||
Logging::info('$p_item contains:');
|
|
||||||
Logging::info($p_item);
|
|
||||||
$file = Application_Model_StoredFile::Recall(
|
$file = Application_Model_StoredFile::Recall(
|
||||||
$p_item['si_file_id']);
|
$p_item['si_file_id']);
|
||||||
if (isset($file)) {
|
if (isset($file)) {
|
||||||
|
@ -242,9 +240,11 @@ class Application_Model_ShowBuilder
|
||||||
|
|
||||||
if (isset($p_item["sched_starts"])) {
|
if (isset($p_item["sched_starts"])) {
|
||||||
|
|
||||||
$schedStartDT = new DateTime($p_item["sched_starts"], new DateTimeZone("UTC"));
|
$schedStartDT = new DateTime($p_item["sched_starts"],
|
||||||
|
new DateTimeZone("UTC"));
|
||||||
$schedStartDT->setTimezone(new DateTimeZone($this->timezone));
|
$schedStartDT->setTimezone(new DateTimeZone($this->timezone));
|
||||||
$schedEndDT = new DateTime($p_item["sched_ends"], new DateTimeZone("UTC"));
|
$schedEndDT = new DateTime($p_item["sched_ends"],
|
||||||
|
new DateTimeZone("UTC"));
|
||||||
$schedEndDT->setTimezone(new DateTimeZone($this->timezone));
|
$schedEndDT->setTimezone(new DateTimeZone($this->timezone));
|
||||||
$showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC"));
|
$showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC"));
|
||||||
|
|
||||||
|
@ -354,7 +354,8 @@ class Application_Model_ShowBuilder
|
||||||
/*
|
/*
|
||||||
* @param int $timestamp Unix timestamp in seconds.
|
* @param int $timestamp Unix timestamp in seconds.
|
||||||
*
|
*
|
||||||
* @return boolean whether the schedule in the show builder's range has been updated.
|
* @return boolean whether the schedule in the show builder's range has
|
||||||
|
* been updated.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function hasBeenUpdatedSince($timestamp, $instances)
|
public function hasBeenUpdatedSince($timestamp, $instances)
|
||||||
|
@ -378,23 +379,26 @@ class Application_Model_ShowBuilder
|
||||||
$currentInstances[] = $show["instance_id"];
|
$currentInstances[] = $show["instance_id"];
|
||||||
|
|
||||||
if (isset($show["last_scheduled"])) {
|
if (isset($show["last_scheduled"])) {
|
||||||
$dt = new DateTime($show["last_scheduled"], new DateTimeZone("UTC"));
|
$dt = new DateTime($show["last_scheduled"],
|
||||||
|
new DateTimeZone("UTC"));
|
||||||
} else {
|
} else {
|
||||||
$dt = new DateTime($show["created"], new DateTimeZone("UTC"));
|
$dt = new DateTime($show["created"],
|
||||||
|
new DateTimeZone("UTC"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//check if any of the shows have a more recent timestamp.
|
//check if any of the shows have a more recent timestamp.
|
||||||
$showTimeStamp = intval($dt->format("U"));
|
$showTimeStamp = intval($dt->format("U"));
|
||||||
if ($timestamp < $showTimeStamp) {
|
if ($timestamp < $showTimeStamp) {
|
||||||
Logging::debug("timestamp is {$timestamp} show timestamp is {$showTimeStamp}");
|
|
||||||
$outdated = true;
|
$outdated = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//see if the displayed show instances have changed. (deleted, empty schedule etc)
|
//see if the displayed show instances have changed. (deleted,
|
||||||
if ($outdated === false && count($instances) !== count($currentInstances)) {
|
//empty schedule etc)
|
||||||
|
if ($outdated === false && count($instances)
|
||||||
|
!== count($currentInstances)) {
|
||||||
Logging::debug("show instances have changed.");
|
Logging::debug("show instances have changed.");
|
||||||
$outdated = true;
|
$outdated = true;
|
||||||
}
|
}
|
||||||
|
@ -415,14 +419,17 @@ class Application_Model_ShowBuilder
|
||||||
$shows[] = $this->opts["showFilter"];
|
$shows[] = $this->opts["showFilter"];
|
||||||
}
|
}
|
||||||
|
|
||||||
$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);
|
$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);
|
||||||
|
|
||||||
for ($i = 0, $rows = count($scheduled_items); $i < $rows; $i++) {
|
for ($i = 0, $rows = count($scheduled_items); $i < $rows; $i++) {
|
||||||
|
|
||||||
$item = $scheduled_items[$i];
|
$item = $scheduled_items[$i];
|
||||||
|
|
||||||
//don't send back data for filler rows.
|
//don't send back data for filler rows.
|
||||||
if (isset($item["playout_status"]) && $item["playout_status"] < 0) {
|
if (isset($item["playout_status"]) &&
|
||||||
|
$item["playout_status"] < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,8 +438,10 @@ class Application_Model_ShowBuilder
|
||||||
|
|
||||||
//make a footer row.
|
//make a footer row.
|
||||||
if ($current_id !== -1) {
|
if ($current_id !== -1) {
|
||||||
//pass in the previous row as it's the last row for the previous show.
|
// pass in the previous row as it's the last row for
|
||||||
$display_items[] = $this->makeFooterRow($scheduled_items[$i-1]);
|
// the previous show.
|
||||||
|
$display_items[] = $this->makeFooterRow(
|
||||||
|
$scheduled_items[$i-1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$display_items[] = $this->makeHeaderRow($item);
|
$display_items[] = $this->makeHeaderRow($item);
|
||||||
|
@ -449,7 +458,8 @@ class Application_Model_ShowBuilder
|
||||||
$display_items[] = $row;
|
$display_items[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($current_id !== -1 && !in_array($current_id, $this->showInstances)) {
|
if ($current_id !== -1 &&
|
||||||
|
!in_array($current_id, $this->showInstances)) {
|
||||||
$this->showInstances[] = $current_id;
|
$this->showInstances[] = $current_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -590,9 +590,7 @@ SQL;
|
||||||
$rebroad = new Application_Model_ShowInstance($rebroadcast->getDbId());
|
$rebroad = new Application_Model_ShowInstance($rebroadcast->getDbId());
|
||||||
$rebroad->addFileToShow($file_id, false);
|
$rebroad->addFileToShow($file_id, false);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
Logging::info("{$e->getFile()}");
|
Logging::info($e->getMessage());
|
||||||
Logging::info("{$e->getLine()}");
|
|
||||||
Logging::info("{$e->getMessage()}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue