aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Node
Commit message (Collapse)AuthorAgeFilesLines
* 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-282-0/+9
|\
| * 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>
| * feat: add searchBySystemTag as PHP APIArthur Schiwon2023-06-211-0/+4
| | | | | | | | 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-213-15/+8
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* | chore: ugly type jugglingArthur Schiwon2023-06-213-13/+18
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* | fix: add typehine for IRootFolderArthur Schiwon2023-06-211-7/+5
|/ | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Merge pull request #38261 from fsamapoor/replace_strpos_calls_in_lib_privateRobin Appelman2023-06-011-3/+3
|\ | | | | Refactors "strpos" calls in lib/private to improve code readability.
| * Refactors "strpos" calls in lib/private to improve code readability.Faraz Samapoor2023-05-151-3/+3
| | | | | | | | Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
* | Merge pull request #32961 from nextcloud/more-debug-lazyuserfolderCôme Chilliet2023-05-152-6/+18
|\ \ | |/ |/| Make it easier to debug issue #32304
| * Add back missing slash in LazyUserFolder pathCôme Chilliet2023-05-091-1/+1
| | | | | | Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
| * Make it easier to debug issue #32304Carl Schwan2023-05-042-7/+19
| | | | | | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* | Merge pull request #37961 from nextcloud/poc/noid/systemtags-perfArthur Schiwon2023-05-111-32/+4
|\ \ | | | | | | SystemTags endpoint to return tags used by a user with meta data
| * | 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>
* / Make sure to never trigger files hooks on a null pathCôme Chilliet2023-05-041-1/+4
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix file_get_content signatures to make it clear it can return falseCôme Chilliet2023-04-271-5/+7
| | | | | | | In File::getContent, which must return a string, throw an Exception instead of returning false. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix: Use proper path when creating node instancesJulius Härtl2023-04-171-1/+5
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Merge pull request #36836 from nextcloud/fix/view-type-cleanupCôme Chilliet2023-04-051-1/+1
|\ | | | | Tidy up typing in OC\Files\View
| * Improve typing for fopen/toTmpFileCôme Chilliet2023-04-031-1/+1
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | Fix inherited parameter namesjld31032023-04-032-4/+4
|/ | | | Signed-off-by: jld3103 <jld3103yt@gmail.com>
* 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-044-17/+28
| |\
| * | 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>
* | | optimize LazyUserFolder::getMountPointRobin Appelman2023-02-132-3/+17
| | | | | | | | | | | | | | | | | | no need to do a full setup Signed-off-by: Robin Appelman <robin@icewind.nl>
* | | only fetch the data for mounts inside a folder when neededRobin Appelman2023-02-094-32/+38
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Type sizes as int|float throughout the code baseCôme Chilliet2023-02-075-7/+7
| | | | | | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | | Merge pull request #34994 from Glandos/fileinfo_perfSimon L2022-11-111-3/+3
|\ \ \ | | | | | | | | [Performance] Test valid path only if file info has to be retrieved
| * | | Test valid path only if file info has to be retrievedGlandos2022-11-061-3/+3
| | | | | | | | | | | | | | | | Signed-off-by: Glandos <bugs-github@antipoul.fr>
* | | | 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-242-9/+20
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Fix typos in lib/private subdirectoryluz paz2022-07-272-2/+2
| | | | | | | | | | | | Found via `codespell -q 3 -S l10n -L jus ./lib/private` Signed-off-by: luz paz <luzpaz@github.com>
* | Move CappedMemoryCache to OCPCarl Schwan2022-07-141-1/+1
| | | | | | | | | | | | | | | | This is an helpful helper that should be used in more place than just server and this is already the case with groupfodlers, deck, user_oidc and more using it, so let's make it public Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* | Fix PHP 8.2 warnings about undeclared propertiesCôme Chilliet2022-06-212-2/+0
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* log stacktrace for 'Backends provided no user object'Arthur Schiwon2022-04-201-1/+3
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* perform a setup if we can't find any mounts containing a fileRobin Appelman2022-04-111-0/+6
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* more preset metadata for LazyUserFolderRobin Appelman2022-04-082-0/+14
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* allow reusing known folder info when getting directory contentsRobin Appelman2022-04-061-2/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* rename cached fileinfo on renameRobin Appelman2022-04-041-0/+9
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* dont needlessly resolve path when getting internalPath/storage from NodeRobin Appelman2022-04-041-7/+5
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>