Skip to content

Commit

Permalink
Merge pull request #510 from nextcloud/performance/less-db-request-pa…
Browse files Browse the repository at this point in the history
…rent-path
  • Loading branch information
skjnldsv authored Apr 5, 2022
2 parents adf8a43 + e9fde1d commit ecfb641
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Service/RecentlyEditedFilesSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ public function getMostRecentRecommendation(IUser $user, int $max): array {

return array_filter(array_map(function (Node $node) use ($userFolder) {
try {
$parentPath = dirname($node->getPath());
if ($parentPath === '' || $parentPath === '.' || $parentPath === '/') {
$parentPath = $node->getParent()->getPath();
}
return new RecommendedFile(
$userFolder->getRelativePath($node->getParent()->getPath()),
$userFolder->getRelativePath($parentPath),
$node,
$node->getMTime(),
$this->l10n->t("Recently edited")
Expand Down

0 comments on commit ecfb641

Please sign in to comment.