]> source.dussan.org Git - nextcloud-server.git/commitdiff
more preset metadata for LazyUserFolder 31901/head
authorRobin Appelman <robin@icewind.nl>
Fri, 8 Apr 2022 13:09:40 +0000 (15:09 +0200)
committerRobin Appelman <robin@icewind.nl>
Fri, 8 Apr 2022 13:09:40 +0000 (15:09 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Files/Node/LazyFolder.php
lib/private/Files/Node/LazyUserFolder.php

index 7d5038e85a25e25af03ea4ad267915e65f931b03..1bae0f52e59151e497a52a5d0219ebb042a483b7 100644 (file)
@@ -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());
        }
 
index d91759117c1b49a2d24d7b4d78b8b744853aa04c..c85a356ddd324884eff1cef082ebb8e5d9a188f1 100644 (file)
@@ -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,
                ]);
        }