Allow single file downloads so the video player works again

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-02-28 16:25:09 +01:00 committed by backportbot[bot]
parent 3846660202
commit 33f360b58c
1 changed files with 10 additions and 8 deletions

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