summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Node/Folder.php
Commit message (Collapse)AuthorAgeFilesLines
* perf: switch places that always use the first getById result to getFirstNodeByIdRobin Appelman2024-03-041-1/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* feat: add interface to get only a single node by id instead of all nodes for ↵Robin Appelman2024-03-041-1/+5
| | | | | | | | the id this should be enough in most(?) cases and makes efficient implementation and caching easier Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix(Folder): Allow filename to be '0'Marcel Klehr2023-10-221-1/+1
| | | | Signed-off-by: Marcel Klehr <mklehr@gmx.net>
* chore: Replace \OC::$server->query with \OCP\Server::get in /libChristoph Wurst2023-07-061-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #37969 from nextcloud/poc/noid/systemtags-perf-tag-endpointJulius Härtl2023-06-281-0/+5
|\
| * fix: cominbation of small fixesArthur Schiwon2023-06-211-2/+2
| | | | | | | | | | | | | | | | - possible null return - parameter name mismatch in implementation - incomplete unit test Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| * fix: change if with conditionless else to switch; and a parameter valueArthur Schiwon2023-06-211-1/+1
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| * use efficient tag retrieval on DAV report requestArthur Schiwon2023-06-211-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - uses DAV search approach against valid files joined by systemtag selector - reduced table join for tag/systemtag search - supports pagination - no changes to the output formats or similar Example request body: <?xml version="1.0"?> <oc:filter-files xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns" xmlns:ocs="http://open-collaboration-services.org/ns"> <d:prop> <d:getcontentlength/> <d:getcontenttype/> <d:getetag/> <d:getlastmodified/> <d:resourcetype/> <nc:face-detections/> <nc:file-metadata-size/> <nc:has-preview/> <nc:realpath/> <oc:favorite/> <oc:fileid/> <oc:permissions/> <nc:nbItems/> </d:prop> <oc:filter-rules> <oc:systemtag>32</oc:systemtag> </oc:filter-rules> <d:limit> <d:nresults>50</d:nresults> <nc:firstresult>0</nc:firstresult> </d:limit> </oc:filter-files> Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* | ci: pro forma check of existence of internal methodArthur Schiwon2023-06-211-7/+9
| | | | | | | | | | | | | | createNode() is protected and used by Folder, but being an internal-only method it shall not be exposed in the Folder or IRootFolder interface. Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* | refactor: declare getMount() and getMountsIn() at IRootFolderArthur Schiwon2023-06-211-6/+2
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* | chore: ugly type jugglingArthur Schiwon2023-06-211-3/+8
|/ | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Refactors "strpos" calls in lib/private to improve code readability.Faraz Samapoor2023-05-151-3/+3
| | | | Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
* refactor: remove SystemTag logic from Folder into QuerySearchHelperArthur Schiwon2023-05-091-52/+1
| | | | | | | - adds OC\SystemTag\SystemTagsInFilesDetector where the search logic is moved to Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* feat: specify media type via url path: systemtags-current/$mediaTypeArthur Schiwon2023-05-091-2/+9
| | | | | | | | | | - only the media part of the mime type can be search, but not the full mime type. It can be added, should it become necessary. - thus fixes previously hardcoded selector for image/ types - also fixes a return type hint - adds a return type hint Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* PoC: SystemTags endpoint to return tags used by a user with meta dataArthur Schiwon2023-05-091-24/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Target case is photos app: when visiting the tags category, all systemtags of the whole cloud are retrieved. In subequent steps the next tag is requested until the browser view is filled with tag tiles (i.e. previews are requested just as well). With this approach, we incorpoate the dav search and look for user related tags that are used by them, and already returns the statistics (number of files tagged with the respective tag) as well as a file id for the purpose to load the preview. This defaults to the file with the highest id. Call: curl -s -u 'user:password' \ 'https://my.nc.srv/remote.php/dav/systemtags-current' \ -X PROPFIND -H 'Accept: text/plain' \ -H 'Accept-Language: en-US,en;q=0.5' -H 'Depth: 1' \ -H 'Content-Type: text/plain;charset=UTF-8' \ --data @/home/doe/request-systemtag-props.xml With request-systemtag-props.xml: <?xml version="1.0" encoding="UTF-8"?> <d:propfind xmlns:d="DAV:"> <d:prop xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns"> <oc:id/> <oc:display-name/> <oc:user-visible/> <oc:user-assignable/> <oc:can-assign/> <nc:files-assigned/> <nc:reference-fileid/> </d:prop> </d:propfind> Example output: … <d:response> <d:href>/master/remote.php/dav/systemtags/84</d:href> <d:propstat> <d:prop> <oc:id>84</oc:id> <oc:display-name>Computer</oc:display-name> <oc:user-visible>true</oc:user-visible> <oc:user-assignable>true</oc:user-assignable> <oc:can-assign>true</oc:can-assign> <nc:files-assigned>42</nc:files-assigned> <nc:reference-fileid>924022</nc:reference-fileid> </d:prop> <d:status>HTTP/1.1 200 OK</d:status> </d:propstat> </d:response> <d:response> <d:href>/remote.php/dav/systemtags/97</d:href> <d:propstat> <d:prop> <oc:id>97</oc:id> <oc:display-name>Bear</oc:display-name> <oc:user-visible>true</oc:user-visible> <oc:user-assignable>true</oc:user-assignable> <oc:can-assign>true</oc:can-assign> <nc:files-assigned>1</nc:files-assigned> <nc:reference-fileid>923422</nc:reference-fileid> </d:prop> <d:status>HTTP/1.1 200 OK</d:status> </d:propstat> </d:response> … Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Merge pull request #33061 from ibpl/master-IB#1121253Côme Chilliet2023-03-141-7/+8
|\ | | | | Paths added to messages and message cleanup
| * Merge masterPawel Boguslawski2022-11-041-9/+10
| |\
| * | Update Folder.phpPaweł Bogusławski2022-07-291-0/+1
| | | | | | | | | | | | Signed-off-by: Pawel Boguslawski <pawel.boguslawski@ib.pl>
| * | Update Folder.phpPaweł Bogusławski2022-07-291-1/+0
| | | | | | | | | | | | Signed-off-by: Pawel Boguslawski <pawel.boguslawski@ib.pl>
| * | Update lib/private/Files/Node/Folder.phpPaweł Bogusławski2022-07-291-1/+1
| | | | | | | | | | | | | | | Co-authored-by: Vincent Petry <vincent@nextcloud.com> Signed-off-by: Pawel Boguslawski <pawel.boguslawski@ib.pl>
| * | Paths added to messages and message cleanupPawel Boguslawski2022-07-291-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This mod adds path to error messages. Without it it's difficult for example to find what path causes permission problems. Related: https://help.nextcloud.com/t/ocp-files-notpermittedexception-could-not-create-folder/133818 Related: https://help.nextcloud.com/t/could-not-create-folder-false-error/65962/ Author-Change-Id: IB#1121253 Signed-off-by: Pawel Boguslawski <pawel.boguslawski@ib.pl>
* | | only fetch the data for mounts inside a folder when neededRobin Appelman2023-02-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | for most operations we don't actually care about any mounts inside a folder, only for metadata that needs to propagate across storage boundaries (size, etag, mtime) do we need all the submount info. By only loading this data when needed we can save a bunch of storage setup in a number of cases Signed-off-by: Robin Appelman <robin@icewind.nl>
* | | Make sure that path is normalized and then checked,Côme Chilliet2022-11-101-7/+8
| | | | | | | | | | | | | | | | | | and not the other way around Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | | Filter out old files when trying to get recent filesCarl Schwan2022-09-051-27/+55
| |/ |/| | | | | | | | | | | Only do so when asking for less than 100 files and having an offset equal to 0. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* | remove leading slash for search results at mountpoint rootRobin Appelman2022-08-291-1/+1
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Only pass parent if paths matchJulius Härtl2022-08-241-3/+5
| | | | | | | | | | | | | | As the user folder might be initialized by the root from two levels down the hierarchy, passing this as a parent only works if the path matches Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Avoid extra query for the parent node if we can pass it alongJulius Härtl2022-08-241-4/+4
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Fix typos in lib/private subdirectoryluz paz2022-07-271-1/+1
| | | | | | | | | | | | Found via `codespell -q 3 -S l10n -L jus ./lib/private` Signed-off-by: luz paz <luzpaz@github.com>
* | Fix PHP 8.2 warnings about undeclared propertiesCôme Chilliet2022-06-211-1/+0
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* allow reusing known folder info when getting directory contentsRobin Appelman2022-04-061-2/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* optimize getById on LazyUserFolder to not require a full fs setupRobin Appelman2022-04-041-64/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* split out some path manipulation logicRobin Appelman2022-04-041-11/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix Folder->getById() when a single storage is mounted multiple timesRobin Appelman2021-07-281-15/+29
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* dont include folder being search in in the resultsRobin Appelman2021-07-021-1/+7
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* update tests and fix some edge cases around new searchRobin Appelman2021-06-141-5/+22
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* some cleanup and documentationRobin Appelman2021-06-141-25/+16
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* perform file search in a single queryRobin Appelman2021-06-141-51/+20
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-1/+0
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* adjust testsRobin Appelman2021-04-211-1/+0
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* use search query for Folder::getRecentRobin Appelman2021-04-211-160/+36
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fail when creating new files with an empty pathJulius Härtl2021-04-201-0/+3
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* getStorage can also return nullRobin Appelman2021-03-241-1/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* getRelativePath can return nullRobin Appelman2021-03-241-1/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* handle ordering in folder searchRobin Appelman2021-03-191-35/+27
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* folder filtering in sqlRobin Appelman2021-03-191-16/+20
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* cleanup fileinfo creationRobin Appelman2021-03-191-9/+16
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* formatRobin Appelman2021-03-181-1/+0
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* handle limit and offset in folder file searchRobin Appelman2021-03-181-6/+51
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* unify handling of Folder::search methods into "new" query objectsRobin Appelman2021-03-181-45/+61
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Bump nextcloud/coding-standard from 0.3.0 to 0.5.0dependabot-preview[bot]2021-02-181-1/+1
| | | | | | | | | | Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0. - [Release notes](https://github.com/nextcloud/coding-standard/releases) - [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>