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>
This commit is contained in:
Robin Appelman 2021-06-18 14:52:35 +02:00
parent 2e38eaa53b
commit a317f0ff02
No known key found for this signature in database
GPG key ID: 42B69D8A64526EFB

View file

@ -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(