Support fileid propfind on trash endpoint
Fixes #9416 In order to support previews on mobile clients they will need the fileid of files in the trashbin. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
8d17d7f6cd
commit
5eb72a8a57
7 changed files with 26 additions and 2 deletions
|
@ -62,7 +62,6 @@ class Helper {
|
|||
$dirContent = $storage->getCache()->getFolderContents($mount->getInternalPath($view->getAbsolutePath($dir)));
|
||||
foreach ($dirContent as $entry) {
|
||||
$entryName = $entry->getName();
|
||||
$id = $entry->getId();
|
||||
$name = $entryName;
|
||||
if ($dir === '' || $dir === '/') {
|
||||
$pathparts = pathinfo($entryName);
|
||||
|
@ -91,7 +90,8 @@ class Helper {
|
|||
'directory' => ($dir === '/') ? '' : $dir,
|
||||
'size' => $entry->getSize(),
|
||||
'etag' => '',
|
||||
'permissions' => Constants::PERMISSION_ALL - Constants::PERMISSION_SHARE
|
||||
'permissions' => Constants::PERMISSION_ALL - Constants::PERMISSION_SHARE,
|
||||
'fileid' => $entry->getId(),
|
||||
);
|
||||
if ($originalPath) {
|
||||
if ($originalPath !== '.') {
|
||||
|
|
|
@ -33,4 +33,6 @@ interface ITrash {
|
|||
public function getDeletionTime(): int;
|
||||
|
||||
public function getSize();
|
||||
|
||||
public function getFileId(): int;
|
||||
}
|
||||
|
|
|
@ -69,6 +69,10 @@ class PropfindPlugin extends ServerPlugin {
|
|||
$propFind->handle(FilesPlugin::SIZE_PROPERTYNAME, function () use ($node) {
|
||||
return $node->getSize();
|
||||
});
|
||||
|
||||
$propFind->handle(FilesPlugin::FILEID_PROPERTYNAME, function () use ($node) {
|
||||
return $node->getFileId();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -90,4 +90,10 @@ class TrashFile implements IFile, ITrash {
|
|||
public function getDeletionTime(): int {
|
||||
return $this->getLastModified();
|
||||
}
|
||||
|
||||
public function getFileId(): int {
|
||||
return $this->data->getId();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -123,4 +123,8 @@ class TrashFolder implements ICollection, ITrash {
|
|||
public function getSize(): int {
|
||||
return $this->data->getSize();
|
||||
}
|
||||
|
||||
public function getFileId(): int {
|
||||
return $this->data->getId();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,4 +101,8 @@ class TrashFolderFile implements IFile, ITrash {
|
|||
public function getDeletionTime(): int {
|
||||
return $this->getLastModified();
|
||||
}
|
||||
|
||||
public function getFileId(): int {
|
||||
return $this->data->getId();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,4 +136,8 @@ class TrashFolderFolder implements ICollection, ITrash {
|
|||
public function getSize(): int {
|
||||
return $this->data->getSize();
|
||||
}
|
||||
|
||||
public function getFileId(): int {
|
||||
return $this->data->getId();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue