Merge branch 'saas-dev' into saas-dev-bandwidth-limits

This commit is contained in:
drigato 2015-11-26 11:30:03 -05:00
commit 34eb7d6e22
13 changed files with 267 additions and 32 deletions

View file

@ -1572,6 +1572,9 @@ class Application_Model_Preference
self::setValue("station_podcast_download_counter", empty($c) ? 0 : --$c);
}
/**
* @return int either 0 (public) or 1 (private)
*/
public static function getStationPodcastPrivacy() {
if (!Billing::isStationPodcastAllowed()) {
// return private setting

View file

@ -482,10 +482,15 @@ class Application_Model_Scheduler
->orderByDbStarts()
->find($this->con);
$now = new DateTime("now", new DateTimeZone("UTC"));
$itemStartDT = $instance->getDbStarts(null);
foreach ($schedule as $item) {
$itemEndDT = $this->findEndTime($itemStartDT, $item->getDbClipLength());
Logging::info($itemEndDT);
// If the track has already ended, don't change it.
if ($itemEndDT < $now) {
$itemStartDT = $itemEndDT;
continue;
}
$item->setDbStarts($itemStartDT)
->setDbEnds($itemEndDT)
->save($this->con);
@ -515,10 +520,15 @@ class Application_Model_Scheduler
->orderByDbStarts()
->find($this->con);
$now = new DateTime("now", new DateTimeZone("UTC"));
$itemStartDT = $instance->getDbStarts(null);
foreach ($schedule as $item) {
$itemEndDT = $this->findEndTime($itemStartDT, $item->getDbClipLength());
// If the track has already ended, don't change it.
if ($itemEndDT < $now) {
$itemStartDT = $itemEndDT;
continue;
}
$item->setDbStarts($itemStartDT)
->setDbEnds($itemEndDT);
@ -1191,7 +1201,7 @@ class Application_Model_Scheduler
foreach ($removedItems as $removedItem) {
$instance = $removedItem->getCcShowInstances($this->con);
$effectedInstanceIds[] = $instance->getDbId();
$effectedInstanceIds[$instance->getDbId()] = $instance->getDbId();
//check if instance is linked and if so get the schedule items
//for all linked instances so we can delete them too