diff options
Diffstat (limited to 'lib/private/Preview/Storage/Root.php')
-rw-r--r-- | lib/private/Preview/Storage/Root.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/private/Preview/Storage/Root.php b/lib/private/Preview/Storage/Root.php index 37ae1758121..a284b037b35 100644 --- a/lib/private/Preview/Storage/Root.php +++ b/lib/private/Preview/Storage/Root.php @@ -32,23 +32,23 @@ use OCP\Files\NotFoundException; use OCP\Files\SimpleFS\ISimpleFolder; class Root extends AppData { + private $isMultibucketPreviewDistributionEnabled = false; public function __construct(IRootFolder $rootFolder, SystemConfig $systemConfig) { parent::__construct($rootFolder, $systemConfig, 'preview'); + + $this->isMultibucketPreviewDistributionEnabled = $systemConfig->getValue('objectstore.multibucket.preview-distribution', false) === true; } public function getFolder(string $name): ISimpleFolder { $internalFolder = $this->getInternalFolder($name); - try { - return parent::getFolder('old-multibucket/' . $internalFolder); - } catch (NotFoundException $e) { - // not in multibucket fallback #1 - } - try { - return parent::getFolder('old-multibucket/' . $name); - } catch (NotFoundException $e) { - // not in multibucket fallback #2 + if ($this->isMultibucketPreviewDistributionEnabled) { + try { + return parent::getFolder('old-multibucket/' . $internalFolder); + } catch (NotFoundException $e) { + // not in multibucket fallback + } } try { |