Skip to content

Commit

Permalink
allow setting offset for queries not limited to the users home storage
Browse files Browse the repository at this point in the history
multi-storage offset is cheap (enough) now

Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Jun 18, 2021
1 parent bdb1525 commit 31bf1e0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions apps/dav/lib/Files/FileSearchBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ private function transformQuery(Query $query): ISearchQuery {
// TODO offset
$limit = $query->limit;
$orders = array_map([$this, 'mapSearchOrder'], $query->orderBy);
$offset = 0;
$offset = $limit->firstResult;

$limitHome = false;
$ownerProp = $this->extractWhereValue($query->where, FilesPlugin::OWNER_ID_PROPERTYNAME, Operator::OPERATION_EQUAL);
Expand All @@ -285,7 +285,6 @@ private function transformQuery(Query $query): ISearchQuery {
} else {
throw new \InvalidArgumentException("Invalid search value for '{http://owncloud.org/ns}owner-id', only the current user id is allowed");
}
$offset = $limit->firstResult;
}

return new SearchQuery(
Expand Down

0 comments on commit 31bf1e0

Please sign in to comment.