From 75cb63beeaf9e1e71cc84aff46a4de6c79ec1136 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 28 Feb 2020 16:25:09 +0100 Subject: [PATCH] Allow single file downloads so the video player works again Signed-off-by: Joas Schilling --- .../lib/Controller/ShareController.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index 0cb0b4eb5fa..72168b3c316 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -545,10 +545,6 @@ class ShareController extends AuthPublicShareController { throw new NotFoundException(); } - if ($share->getHideDownload()) { - return new NotFoundResponse(); - } - $userFolder = $this->rootFolder->getUserFolder($share->getShareOwner()); $originalSharePath = $userFolder->getRelativePath($share->getNode()->getPath()); @@ -578,11 +574,17 @@ class ShareController extends AuthPublicShareController { if ($node instanceof \OCP\Files\File) { // Single file download $this->singleFileDownloaded($share, $share->getNode()); - } else if (!empty($files_list)) { - $this->fileListDownloaded($share, $files_list, $node); } else { - // The folder is downloaded - $this->singleFileDownloaded($share, $share->getNode()); + if ($share->getHideDownload()) { + return new NotFoundResponse(); + } + + if (!empty($files_list)) { + $this->fileListDownloaded($share, $files_list, $node); + } else { + // The folder is downloaded + $this->singleFileDownloaded($share, $share->getNode()); + } } } -- 2.39.5