mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
more preset metadata for LazyUserFolder
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
54e52e9b5e
commit
499749dbc1
2 changed files with 14 additions and 0 deletions
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue