aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-10-14 15:33:13 +0200
committerGitHub <noreply@github.com>2022-10-14 15:33:13 +0200
commit95d45c20580683a7ed332b2e313ee42b8b728bc7 (patch)
treec7daa4c7f930d43723ea727bdc07b2ec22259f9c /apps/files_sharing
parent2cef188b41fd544cbcfe8d279c0afbf6cf4b5a10 (diff)
parentc0bd7484c665edb28f6e2b08a9ea1229438b846e (diff)
downloadnextcloud-server-95d45c20580683a7ed332b2e313ee42b8b728bc7.tar.gz
nextcloud-server-95d45c20580683a7ed332b2e313ee42b8b728bc7.zip
Merge pull request #34471 from starypatyk/dav_read_share_notes
Reduce number of database queries during WebDAV propfind request
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/MountProvider.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php
index 954c9cf70e6..a9705e94906 100644
--- a/apps/files_sharing/lib/MountProvider.php
+++ b/apps/files_sharing/lib/MountProvider.php
@@ -229,6 +229,13 @@ class MountProvider implements IMountProvider {
->setShareType($shares[0]->getShareType())
->setTarget($shares[0]->getTarget());
+ // Gather notes from all the shares.
+ // Since these are readly available here, storing them
+ // enables the DAV FilesPlugin to avoid executing many
+ // DB queries to retrieve the same information.
+ $allNotes = implode("\n", array_map(function ($sh) { return $sh->getNote(); }, $shares));
+ $superShare->setNote($allNotes);
+
// use most permissive permissions
// this covers the case where there are multiple shares for the same
// file e.g. from different groups and different permissions