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:
James 2012-11-06 16:32:00 -05:00
parent c605c97268
commit 504d9968f1
3 changed files with 6 additions and 5 deletions

View file

@ -1191,7 +1191,7 @@ SQL;
$sizeOfInsert = count($insertList);
// 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));
$insertList[] = $insertList[$randomEleKey];
$totalTime += $insertList[$randomEleKey]['length'];