From c57495a4292f69788b14cc993c1421257d5fa4b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pauli=20J=C3=A4rvinen?= Date: Mon, 6 Jan 2025 12:41:28 +0200 Subject: [PATCH] fix(preview): Do not try to parse M3U files as MP3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By default, the MP3 audio files get the mimetype `audio/mpeg` and the M3U and M3U8 playlist files get the mimetype `audio/mpegurl`. PreviewManager had such a problem that it registered the MP3 preview provider with a regular expression which matched also the M3U files. This caused an error message to be logged on the info (1) level for each M3U file every time a folder with such files was viewed: "Error while getting cover from mp3 file: File /path/to/some/playlist.m3u is not mpeg/audio!". Signed-off-by: Pauli Järvinen --- lib/private/PreviewManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/PreviewManager.php b/lib/private/PreviewManager.php index f19ff25abb786..6571643d3d03d 100644 --- a/lib/private/PreviewManager.php +++ b/lib/private/PreviewManager.php @@ -343,7 +343,7 @@ protected function registerCoreProviders() { $this->registerCoreProvider(Preview\XBitmap::class, '/image\/x-xbitmap/'); $this->registerCoreProvider(Preview\WebP::class, '/image\/webp/'); $this->registerCoreProvider(Preview\Krita::class, '/application\/x-krita/'); - $this->registerCoreProvider(Preview\MP3::class, '/audio\/mpeg/'); + $this->registerCoreProvider(Preview\MP3::class, '/audio\/mpeg$/'); $this->registerCoreProvider(Preview\OpenDocument::class, '/application\/vnd.oasis.opendocument.*/'); $this->registerCoreProvider(Preview\Imaginary::class, Preview\Imaginary::supportedMimeTypes()); $this->registerCoreProvider(Preview\ImaginaryPDF::class, Preview\ImaginaryPDF::supportedMimeTypes());