diff options
author | icewind1991 <robin@icewind.nl> | 2014-02-26 12:18:34 +0100 |
---|---|---|
committer | icewind1991 <robin@icewind.nl> | 2014-02-26 12:18:34 +0100 |
commit | 59df3ffdf4647fcff1996017723af8c5eca72522 (patch) | |
tree | 3ea16ca80bd0859892769b489931384076167982 | |
parent | 8759c35e749fd67dcc3778832146cffd3abd228e (diff) | |
parent | 3487a95eaba04e6ced29d86a7cba9151513a1703 (diff) | |
download | nextcloud-server-59df3ffdf4647fcff1996017723af8c5eca72522.tar.gz nextcloud-server-59df3ffdf4647fcff1996017723af8c5eca72522.zip |
Merge pull request #7279 from owncloud/folderid-reuse
Reuse the folder id in View->getFolderContents
-rw-r--r-- | lib/private/files/cache/cache.php | 10 | ||||
-rw-r--r-- | lib/private/files/view.php | 5 |
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php index 4cab4619149..9b18257088c 100644 --- a/lib/private/files/cache/cache.php +++ b/lib/private/files/cache/cache.php @@ -166,6 +166,16 @@ class Cache { */ public function getFolderContents($folder) { $fileId = $this->getId($folder); + return $this->getFolderContentsById($fileId); + } + + /** + * get the metadata of all files stored in $folder + * + * @param int $fileId the file id of the folder + * @return array + */ + public function getFolderContentsById($fileId) { if ($fileId > -1) { $sql = 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, `encrypted`, `unencrypted_size`, `etag` diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 6f235be8e34..2dbbf5b88c9 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -882,12 +882,13 @@ class View { $watcher->checkUpdate($internalPath); } + $folderId = $cache->getId($internalPath); $files = array(); - $contents = $cache->getFolderContents($internalPath); //TODO: mimetype_filter + $contents = $cache->getFolderContents($internalPath, $folderId); //TODO: mimetype_filter foreach ($contents as $content) { $files[] = new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content); } - $permissions = $permissionsCache->getDirectoryPermissions($cache->getId($internalPath), $user); + $permissions = $permissionsCache->getDirectoryPermissions($folderId, $user); $ids = array(); foreach ($files as $i => $file) { |