From a4bf0f69be5c87c5f9377b82cd4f31b00196ce73 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Wed, 3 Jul 2024 11:49:08 +0200 Subject: [PATCH 1/2] feat: log file id and path when extracting the mp3 cover fails Signed-off-by: Daniel Kesselberg [skip ci] --- lib/private/Preview/MP3.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/private/Preview/MP3.php b/lib/private/Preview/MP3.php index 4c5f932f47792..1cb61b1352b17 100644 --- a/lib/private/Preview/MP3.php +++ b/lib/private/Preview/MP3.php @@ -30,8 +30,8 @@ use OCP\Files\File; use OCP\IImage; -use Psr\Log\LoggerInterface; use wapmorgan\Mp3Info\Mp3Info; +use function OCP\Log\logger; class MP3 extends ProviderV2 { /** @@ -52,9 +52,9 @@ public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage { /** @var string|null|false $picture */ $picture = $audio->getCover(); } catch (\Throwable $e) { - \OC::$server->get(LoggerInterface::class)->info($e->getMessage(), [ - 'exception' => $e, - 'app' => 'core', + logger('core')->info('Error while getting cover from mp3 file: ' . $e->getMessage(), [ + 'fileId' => $file->getId(), + 'filePath' => $file->getPath(), ]); return null; } finally { From f61bb588056b4f98c1240346f263814e1e65a49b Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Thu, 4 Jul 2024 15:04:48 +0200 Subject: [PATCH 2/2] chore(mp3info): apply upstream patch for invalid array access Patch: wapmorgan/Mp3Info#36 Signed-off-by: Daniel Kesselberg --- 3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty b/3rdparty index aafe4fb8d564d..d8dff588a473a 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit aafe4fb8d564d653a626a3a1120711df7324f77c +Subproject commit d8dff588a473a7c60d74ad64044d4830fd23f180