Browse Source

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>
tags/v14.0.0beta1
Roeland Jago Douma 6 years ago
parent
commit
5eb72a8a57
No account linked to committer's email address

+ 2
- 2
apps/files_trashbin/lib/Helper.php View File

@@ -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 !== '.') {

+ 2
- 0
apps/files_trashbin/lib/Sabre/ITrash.php View File

@@ -33,4 +33,6 @@ interface ITrash {
public function getDeletionTime(): int;

public function getSize();

public function getFileId(): int;
}

+ 4
- 0
apps/files_trashbin/lib/Sabre/PropfindPlugin.php View File

@@ -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();
});
}

}

+ 6
- 0
apps/files_trashbin/lib/Sabre/TrashFile.php View File

@@ -90,4 +90,10 @@ class TrashFile implements IFile, ITrash {
public function getDeletionTime(): int {
return $this->getLastModified();
}

public function getFileId(): int {
return $this->data->getId();
}


}

+ 4
- 0
apps/files_trashbin/lib/Sabre/TrashFolder.php View File

@@ -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();
}
}

+ 4
- 0
apps/files_trashbin/lib/Sabre/TrashFolderFile.php View File

@@ -101,4 +101,8 @@ class TrashFolderFile implements IFile, ITrash {
public function getDeletionTime(): int {
return $this->getLastModified();
}

public function getFileId(): int {
return $this->data->getId();
}
}

+ 4
- 0
apps/files_trashbin/lib/Sabre/TrashFolderFolder.php View File

@@ -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…
Cancel
Save