]> source.dussan.org Git - nextcloud-server.git/commitdiff
Update PreviewManager.php
authorWilliam <william.hak57@gmail.com>
Wed, 18 Jan 2023 15:30:41 +0000 (16:30 +0100)
committerGitHub <noreply@github.com>
Wed, 18 Jan 2023 15:30:41 +0000 (16:30 +0100)
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 <william.hak57@gmail.com>
lib/private/PreviewManager.php

index 87e709e9bccfaf7f1c8230d7270e0c6a1b7dfb3a..eac3f40efc21734631ea388bd1c2bbbebe833f08 100644 (file)
@@ -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]);
                        }