diff options
author | Robin Appelman <robin@icewind.nl> | 2022-04-08 15:09:40 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2022-04-08 15:09:40 +0200 |
commit | 499749dbc1dc3be1b223914926f3889883987d1e (patch) | |
tree | a162c1178d192848b06ae1d929217848392f8009 /lib/private/Files | |
parent | 54e52e9b5e569942f9daa7f00876006e90736a61 (diff) | |
download | nextcloud-server-499749dbc1dc3be1b223914926f3889883987d1e.tar.gz nextcloud-server-499749dbc1dc3be1b223914926f3889883987d1e.zip |
more preset metadata for LazyUserFolder
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files')
-rw-r--r-- | lib/private/Files/Node/LazyFolder.php | 11 | ||||
-rw-r--r-- | lib/private/Files/Node/LazyUserFolder.php | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/private/Files/Node/LazyFolder.php b/lib/private/Files/Node/LazyFolder.php index 7d5038e85a2..1bae0f52e59 100644 --- a/lib/private/Files/Node/LazyFolder.php +++ b/lib/private/Files/Node/LazyFolder.php @@ -23,6 +23,7 @@ declare(strict_types=1); * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ + namespace OC\Files\Node; use OC\Files\Utils\PathHelper; @@ -310,6 +311,9 @@ class LazyFolder implements \OCP\Files\Folder { * @inheritDoc */ public function getMimetype() { + if (isset($this->data['mimetype'])) { + return $this->data['mimetype']; + } return $this->__call(__FUNCTION__, func_get_args()); } @@ -317,6 +321,10 @@ class LazyFolder implements \OCP\Files\Folder { * @inheritDoc */ public function getMimePart() { + if (isset($this->data['mimetype'])) { + [$part,] = explode('/', $this->data['mimetype']); + return $part; + } return $this->__call(__FUNCTION__, func_get_args()); } @@ -331,6 +339,9 @@ class LazyFolder implements \OCP\Files\Folder { * @inheritDoc */ public function getType() { + if (isset($this->data['type'])) { + return $this->data['type']; + } return $this->__call(__FUNCTION__, func_get_args()); } diff --git a/lib/private/Files/Node/LazyUserFolder.php b/lib/private/Files/Node/LazyUserFolder.php index d91759117c1..c85a356ddd3 100644 --- a/lib/private/Files/Node/LazyUserFolder.php +++ b/lib/private/Files/Node/LazyUserFolder.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace OC\Files\Node; +use OCP\Files\FileInfo; use OCP\Constants; use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; @@ -49,6 +50,8 @@ class LazyUserFolder extends LazyFolder { }, [ 'path' => $this->path, 'permissions' => Constants::PERMISSION_ALL, + 'type' => FileInfo::TYPE_FOLDER, + 'mimetype' => FileInfo::MIMETYPE_FOLDER, ]); } |