diff --git a/lib/private/Preview/Movie.php b/lib/private/Preview/Movie.php index 7b9c7a26f77b1..41dbefd3fb7fd 100644 --- a/lib/private/Preview/Movie.php +++ b/lib/private/Preview/Movie.php @@ -84,13 +84,35 @@ public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage { if ($result === null) { $result = $this->generateThumbNail($maxX, $maxY, $absPath, 0); } + Server::get(LoggerInterface::class)->debug( + 'Movie preview generation attempt failed' + . ', file=' . $file->getPath() + . ', time=' . $timeStamp + . ', size=' . ($size ?? 'entire file'), + ['app' => 'core'] + ); } $this->cleanTmpFiles(); if ($result !== null) { + Server::get(LoggerInterface::class)->debug( + 'Movie preview generation attempt success' + . ', file=' . $file->getPath() + . ', time=' . $timeStamp + . ', size=' . ($size ?? 'entire file'), + ['app' => 'core'] + ); break; } + + } + if ($result === null) { + Server::get(LoggerInterface::class)->error( + 'Movie preview generation process failed' + . ', file=' . $file->getPath(), + ['app' => 'core'] + ); } return $result; @@ -167,21 +189,23 @@ private function generateThumbNail(int $maxX, int $maxY, string $absPath, int $s $output = $stdout . $stderr; } + Server::get(LoggerInterface::class)->debug( + 'Movie preview generation output' + . ', file=' . $absPath + . ', output=', + ['app' => 'core', 'output' => $output] + ); + if ($returnCode === 0) { $image = new \OCP\Image(); $image->loadFromFile($tmpPath); if ($image->valid()) { unlink($tmpPath); $image->scaleDownToFit($maxX, $maxY); - return $image; } } - if ($second === 0) { - $logger = Server::get(LoggerInterface::class); - $logger->info('Movie preview generation failed Output: {output}', ['app' => 'core', 'output' => $output]); - } unlink($tmpPath); return null;