CC-4264: Smart Block: Fail to generate block with some unavailable files

- fixed
This commit is contained in:
James 2012-08-24 17:02:37 -04:00
parent c561f36aa1
commit 2ca4a369b2
2 changed files with 13 additions and 11 deletions

View file

@ -430,13 +430,16 @@ EOT;
foreach ($p_items as $ac) {
Logging::info("Adding audio file {$ac}");
if (is_array($ac) && $ac[1] == 'audioclip') {
$res = $this->insertBlockElement($this->buildEntry($ac[0], $pos));
$pos = $pos + 1;
} elseif (!is_array($ac)) {
$res = $this->insertBlockElement($this->buildEntry($ac, $pos));
$pos = $pos + 1;
try {
if (is_array($ac) && $ac[1] == 'audioclip') {
$res = $this->insertBlockElement($this->buildEntry($ac[0], $pos));
$pos = $pos + 1;
} elseif (!is_array($ac)) {
$res = $this->insertBlockElement($this->buildEntry($ac, $pos));
$pos = $pos + 1;
}
} catch (Exception $e) {
Logging::log($e->getMessage());
}
}
@ -1223,8 +1226,8 @@ EOT;
$limits['time'] = 1440 * 60;
$limits['items'] = $storedCrit['limit']['value'];
} else {
$limits['time'] = $storedCrit['limit']['modifier'] == "hours" ?
intval(floatval($storedCrit['limit']['value']) * 60 * 60) :
$limits['time'] = $storedCrit['limit']['modifier'] == "hours" ?
intval(floatval($storedCrit['limit']['value']) * 60 * 60) :
intval($storedCrit['limit']['value'] * 60);
$limits['items'] = null;
}