diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-04-11 11:24:09 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-07-05 16:20:32 +0200 |
commit | 0984970cd8759ae2dcd7dfdfe41d5816bf3c2948 (patch) | |
tree | c215c2dfd3235d9d022f01eb0dd7dbdac969547a /apps/files_trashbin | |
parent | 79d24bfb8eebd82dd75b15c5503a4bb33563ee69 (diff) | |
download | nextcloud-server-0984970cd8759ae2dcd7dfdfe41d5816bf3c2948.tar.gz nextcloud-server-0984970cd8759ae2dcd7dfdfe41d5816bf3c2948.zip |
feat(files): favorites
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r-- | apps/files_trashbin/lib/Controller/PreviewController.php | 2 | ||||
-rw-r--r-- | apps/files_trashbin/src/services/trashbin.ts | 16 | ||||
-rw-r--r-- | apps/files_trashbin/tests/Controller/PreviewControllerTest.php | 2 |
3 files changed, 7 insertions, 13 deletions
diff --git a/apps/files_trashbin/lib/Controller/PreviewController.php b/apps/files_trashbin/lib/Controller/PreviewController.php index 652570dccd7..9f60cc8b0b2 100644 --- a/apps/files_trashbin/lib/Controller/PreviewController.php +++ b/apps/files_trashbin/lib/Controller/PreviewController.php @@ -119,7 +119,7 @@ class PreviewController extends Controller { $mimeType = $this->mimeTypeDetector->detectPath($file->getName()); } - $f = $this->previewManager->getPreview($file, $x, $y, $a, IPreview::MODE_FILL, $mimeType); + $f = $this->previewManager->getPreview($file, $x, $y, !$a, IPreview::MODE_FILL, $mimeType); $response = new Http\FileDisplayResponse($f, Http::STATUS_OK, ['Content-Type' => $f->getMimeType()]); // Cache previews for 24H diff --git a/apps/files_trashbin/src/services/trashbin.ts b/apps/files_trashbin/src/services/trashbin.ts index 9982750ba5c..ab48863317a 100644 --- a/apps/files_trashbin/src/services/trashbin.ts +++ b/apps/files_trashbin/src/services/trashbin.ts @@ -25,27 +25,19 @@ import { File, Folder, parseWebdavPermissions } from '@nextcloud/files' import { generateRemoteUrl, generateUrl } from '@nextcloud/router' import type { FileStat, ResponseDataDetailed } from 'webdav' +import { getDavNameSpaces, getDavProperties } from '../../../files/src/services/DavProperties' import type { ContentsWithRoot } from '../../../files/src/services/Navigation.ts' import client, { rootPath } from './client' const data = `<?xml version="1.0"?> -<d:propfind xmlns:d="DAV:" - xmlns:oc="http://owncloud.org/ns" - xmlns:nc="http://nextcloud.org/ns"> +<d:propfind ${getDavNameSpaces()}> <d:prop> <nc:trashbin-filename /> <nc:trashbin-deletion-time /> <nc:trashbin-original-location /> <nc:trashbin-title /> - <d:getlastmodified /> - <d:getetag /> - <d:getcontenttype /> - <d:resourcetype /> - <oc:fileid /> - <oc:permissions /> - <oc:size /> - <d:getcontentlength /> + ${getDavProperties()} </d:prop> </d:propfind>` @@ -73,6 +65,8 @@ const resultToNode = function(node: FileStat): File | Folder { }, } + delete nodeData.attributes.props + return node.type === 'file' ? new File(nodeData) : new Folder(nodeData) diff --git a/apps/files_trashbin/tests/Controller/PreviewControllerTest.php b/apps/files_trashbin/tests/Controller/PreviewControllerTest.php index 4db3d4f613c..3b114484c7f 100644 --- a/apps/files_trashbin/tests/Controller/PreviewControllerTest.php +++ b/apps/files_trashbin/tests/Controller/PreviewControllerTest.php @@ -157,7 +157,7 @@ class PreviewControllerTest extends TestCase { $this->overwriteService(ITimeFactory::class, $this->time); - $res = $this->controller->getPreview(42, 10, 10, true); + $res = $this->controller->getPreview(42, 10, 10, false); $expected = new FileDisplayResponse($preview, Http::STATUS_OK, ['Content-Type' => 'previewMime']); $expected->cacheFor(3600 * 24); |