Skip to content

Commit

Permalink
feat: log file id and path when extracting the mp3 cover fails
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>

[skip ci]
  • Loading branch information
kesselb authored and backportbot[bot] committed Jul 4, 2024
1 parent adaf85a commit 0fd5ad1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/private/Preview/MP3.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand All @@ -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 {
Expand Down

0 comments on commit 0fd5ad1

Please sign in to comment.