Merge pull request #7279 from owncloud/folderid-reuse
Reuse the folder id in View->getFolderContents
This commit is contained in:
commit
59df3ffdf4
|
@ -166,6 +166,16 @@ class Cache {
|
||||||
*/
|
*/
|
||||||
public function getFolderContents($folder) {
|
public function getFolderContents($folder) {
|
||||||
$fileId = $this->getId($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) {
|
if ($fileId > -1) {
|
||||||
$sql = 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`,
|
$sql = 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`,
|
||||||
`storage_mtime`, `encrypted`, `unencrypted_size`, `etag`
|
`storage_mtime`, `encrypted`, `unencrypted_size`, `etag`
|
||||||
|
|
|
@ -882,12 +882,13 @@ class View {
|
||||||
$watcher->checkUpdate($internalPath);
|
$watcher->checkUpdate($internalPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$folderId = $cache->getId($internalPath);
|
||||||
$files = array();
|
$files = array();
|
||||||
$contents = $cache->getFolderContents($internalPath); //TODO: mimetype_filter
|
$contents = $cache->getFolderContents($internalPath, $folderId); //TODO: mimetype_filter
|
||||||
foreach ($contents as $content) {
|
foreach ($contents as $content) {
|
||||||
$files[] = new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $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();
|
$ids = array();
|
||||||
foreach ($files as $i => $file) {
|
foreach ($files as $i => $file) {
|
||||||
|
|
Loading…
Reference in New Issue