From 1409a7cc926b00674a9e2ada2d38d1cbbd0e91eb Mon Sep 17 00:00:00 2001 From: William Date: Wed, 18 Jan 2023 16:30:41 +0100 Subject: Update PreviewManager.php add a check in config.php for a configured movieBinary path. so now it first checks in config.php if preview_ffmpeg_path is configured. Signed-off-by: William --- lib/private/PreviewManager.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/private/PreviewManager.php b/lib/private/PreviewManager.php index 87e709e9bcc..eac3f40efc2 100644 --- a/lib/private/PreviewManager.php +++ b/lib/private/PreviewManager.php @@ -417,11 +417,16 @@ class PreviewManager implements IPreview { // Video requires avconv or ffmpeg if (in_array(Preview\Movie::class, $this->getEnabledDefaultProvider())) { - $movieBinary = $this->binaryFinder->findBinaryPath('avconv'); - if (!is_string($movieBinary)) { - $movieBinary = $this->binaryFinder->findBinaryPath('ffmpeg'); + + $movieBinary = $this->config->getSystemValue('preview_ffmpeg_path', null); + if(!is_string($movieBinary)){ + $movieBinary = $this->binaryFinder->findBinaryPath('avconv'); + if (!is_string($movieBinary)) { + $movieBinary = $this->binaryFinder->findBinaryPath('ffmpeg'); + } } + if (is_string($movieBinary)) { $this->registerCoreProvider(Preview\Movie::class, '/video\/.*/', ["movieBinary" => $movieBinary]); } -- cgit v1.2.3