Skip to content

Commit

Permalink
Merge pull request #5961 from nextcloud/perf-workspace-dav-node
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored Jun 27, 2024
2 parents 33bda5b + 1fdd5d3 commit d5a5896
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions lib/DAV/WorkspacePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
namespace OCA\Text\DAV;

use OC\Files\Node\File;
use OC\Files\Node\Folder;
use OCA\DAV\Connector\Sabre\Directory;
use OCA\DAV\Files\FilesHome;
use OCA\Text\AppInfo\Application;
Expand Down Expand Up @@ -77,16 +76,11 @@ public function propFind(PropFind $propFind, INode $node) {
return;
}

$file = null;
$owner = $this->userId ?? $node->getFileInfo()->getStorage()->getOwner('');
$node = $this->rootFolder->getUserFolder($owner)->getFirstNodeById($node->getId());
if ($node instanceof Folder) {
/** @var File $file */
try {
$file = $this->workspaceService->getFile($node);
} catch (StorageNotAvailableException $e) {
// If a storage is not available we can for the propfind response assume that there is no rich workspace present
}
$node = $node->getNode();
try {
$file = $this->workspaceService->getFile($node);
} catch (StorageNotAvailableException $e) {
$file = null;
}

// Only return the property for the parent node and ignore it for further in depth nodes
Expand Down

0 comments on commit d5a5896

Please sign in to comment.