summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-06-18 14:52:35 +0200
committerRobin Appelman <robin@icewind.nl>2021-06-22 20:38:14 +0200
commita317f0ff020a26f687ae188f6d282f09872dd515 (patch)
treee4dba722654c0d839e1a0fff502f3c00f25f83f4
parent2e38eaa53b62adf9b7ea07f63f9211e14b365fda (diff)
downloadnextcloud-server-a317f0ff020a26f687ae188f6d282f09872dd515.tar.gz
nextcloud-server-a317f0ff020a26f687ae188f6d282f09872dd515.zip
allow setting offset for queries not limited to the users home storage
multi-storage offset is cheap (enough) now Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--apps/dav/lib/Files/FileSearchBackend.php4
1 files changed, 1 insertions, 3 deletions
diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php
index 1732b0cc85a..71231f65c24 100644
--- a/apps/dav/lib/Files/FileSearchBackend.php
+++ b/apps/dav/lib/Files/FileSearchBackend.php
@@ -272,10 +272,9 @@ class FileSearchBackend implements ISearchBackend {
* @return ISearchQuery
*/
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);
@@ -285,7 +284,6 @@ class FileSearchBackend implements ISearchBackend {
} 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(