Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Martin Konecny 2012-08-08 11:48:57 -04:00
commit 3dc96e3422
1 changed files with 4 additions and 1 deletions

View File

@ -1211,6 +1211,7 @@ EOT;
$insertList = array();
$totalTime = 0;
$totalItems = 0;
// this moves the pointer to the first element in the collection
$files->getFirst();
@ -1220,7 +1221,9 @@ EOT;
$length = Application_Common_DateHelper::calculateLengthInSeconds($iterator->current()->getDbLength());
$insertList[$id] = $length;
$totalTime += $length;
if ( !is_null($limit['items']) && $limit['items'] == count($insertList)) {
$totalItems++;
if ((!is_null($limit['items']) && $limit['items'] == count($insertList)) || $totalItems > 500) {
break;
}