diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index b4835eaf4a2d9..5b0b082537a0c 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -373,14 +373,14 @@ public function downloadShare($token, $files = null, $path = '', $downloadStartS $userFolder = $this->rootFolder->getUserFolder($share->getShareOwner()); $originalSharePath = $userFolder->getRelativePath($share->getNode()->getPath()); - $isVideo = false; + $isVideoAudio = false; // Single file share if ($share->getNode() instanceof \OCP\Files\File) { $node = $share->getNode(); // Single file download $this->singleFileDownloaded($share, $node); - $isVideo = str_starts_with($node->getMimeType(), 'video/'); + $isVideoAutio = str_starts_with($node->getMimeType(), 'video/') || str_starts_with($node->getMimeType(), 'audio/'); } // Directory share else { @@ -404,7 +404,7 @@ public function downloadShare($token, $files = null, $path = '', $downloadStartS $node = $share->getNode(); // Single file download $this->singleFileDownloaded($share, $node); - $isVideo = str_starts_with($node->getMimeType(), 'video/'); + $isVideoAutio = str_starts_with($node->getMimeType(), 'video/') || str_starts_with($node->getMimeType(), 'audio/'); } else { try { if (!empty($files_list)) { @@ -437,8 +437,8 @@ public function downloadShare($token, $files = null, $path = '', $downloadStartS $this->emitAccessShareHook($share); - // Ensure download limit is counted unless we are streaming a video - if (!isset($_SERVER['HTTP_RANGE']) || !$isVideo) { + // Ensure download limit is counted unless we are streaming a video or audio file + if (!isset($_SERVER['HTTP_RANGE']) || !$isVideoAudio) { $this->emitShareAccessEvent($share, self::SHARE_DOWNLOAD); }