Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/private/Files/Node/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ public function getRecent($limit, $offset = 0) {
// Search in batches of 500 entries
$searchLimit = 500;
$results = [];
$searchResultCount = 0;
$count = 0;
do {
$searchResult = $this->recentSearch($searchLimit, $offset, $storageIds, $folderMimetype);

Expand All @@ -391,14 +393,17 @@ public function getRecent($limit, $offset = 0) {
break;
}

$searchResultCount += count($searchResult);

$parseResult = $this->recentParse($searchResult, $mountMap, $mimetypeLoader);

foreach ($parseResult as $result) {
$results[] = $result;
}

$offset += $searchLimit;
} while (count($results) < $limit);
$count++;
} while (count($results) < $limit && ($searchResultCount < (3 * $limit) || $count < 5));

return array_slice($results, 0, $limit);
}
Expand Down