CC-4639:
Give an option to allow smart blocks to reuse tracks if not enough tracks meet the time limit - fixed the bug where airtime hangs when repeat is checked but 0 files that meet criteria - fixed dynamic block bug where it didn't generate correct list
This commit is contained in:
parent
c605c97268
commit
504d9968f1
|
@ -513,7 +513,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
} catch (BlockNotFoundException $e) {
|
} catch (BlockNotFoundException $e) {
|
||||||
$this->playlistNotFound('block', true);
|
$this->playlistNotFound('block', true);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
//Logging::info($e);
|
Logging::info($e);
|
||||||
$this->playlistUnknownError($e);
|
$this->playlistUnknownError($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1191,7 +1191,7 @@ SQL;
|
||||||
$sizeOfInsert = count($insertList);
|
$sizeOfInsert = count($insertList);
|
||||||
|
|
||||||
// if block is not full and reapeat_track is check, fill up more
|
// if block is not full and reapeat_track is check, fill up more
|
||||||
while (!$isBlockFull && $repeat == 1) {
|
while (!$isBlockFull && $repeat == 1 && $sizeOfInsert > 0) {
|
||||||
$randomEleKey = array_rand(array_slice($insertList, 0, $sizeOfInsert));
|
$randomEleKey = array_rand(array_slice($insertList, 0, $sizeOfInsert));
|
||||||
$insertList[] = $insertList[$randomEleKey];
|
$insertList[] = $insertList[$randomEleKey];
|
||||||
$totalTime += $insertList[$randomEleKey]['length'];
|
$totalTime += $insertList[$randomEleKey]['length'];
|
||||||
|
|
|
@ -193,7 +193,8 @@ class Application_Model_Scheduler
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$dynamicFiles = $bl->getListOfFilesUnderLimit();
|
$dynamicFiles = $bl->getListOfFilesUnderLimit();
|
||||||
foreach ($dynamicFiles as $fileId=>$f) {
|
foreach ($dynamicFiles as $f) {
|
||||||
|
$fileId = $f['id'];
|
||||||
$file = CcFilesQuery::create()->findPk($fileId);
|
$file = CcFilesQuery::create()->findPk($fileId);
|
||||||
if (isset($file) && $file->getDbFileExists()) {
|
if (isset($file) && $file->getDbFileExists()) {
|
||||||
$data["id"] = $file->getDbId();
|
$data["id"] = $file->getDbId();
|
||||||
|
@ -250,7 +251,8 @@ class Application_Model_Scheduler
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$dynamicFiles = $bl->getListOfFilesUnderLimit();
|
$dynamicFiles = $bl->getListOfFilesUnderLimit();
|
||||||
foreach ($dynamicFiles as $fileId=>$f) {
|
foreach ($dynamicFiles as $f) {
|
||||||
|
$fileId = $f['id'];
|
||||||
$file = CcFilesQuery::create()->findPk($fileId);
|
$file = CcFilesQuery::create()->findPk($fileId);
|
||||||
if (isset($file) && $file->getDbFileExists()) {
|
if (isset($file) && $file->getDbFileExists()) {
|
||||||
$data["id"] = $file->getDbId();
|
$data["id"] = $file->getDbId();
|
||||||
|
@ -445,7 +447,6 @@ class Application_Model_Scheduler
|
||||||
} else {
|
} else {
|
||||||
$sched = new CcSchedule();
|
$sched = new CcSchedule();
|
||||||
}
|
}
|
||||||
Logging::info($file);
|
|
||||||
$sched->setDbStarts($nextStartDT)
|
$sched->setDbStarts($nextStartDT)
|
||||||
->setDbEnds($endTimeDT)
|
->setDbEnds($endTimeDT)
|
||||||
->setDbCueIn($file['cuein'])
|
->setDbCueIn($file['cuein'])
|
||||||
|
|
Loading…
Reference in New Issue