]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow single file downloads so the video player works again
authorJoas Schilling <coding@schilljs.com>
Fri, 28 Feb 2020 15:25:09 +0000 (16:25 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 24 Mar 2020 19:31:43 +0000 (19:31 +0000)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/files_sharing/lib/Controller/ShareController.php

index 37a564d76540fd518344f0d125891ef5f7c6d2fa..307152dcc9b367d8336b7b851a65307f16a5c65c 100644 (file)
@@ -527,10 +527,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());
 
@@ -560,11 +556,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());
+                               }
                        }
                }