diff options
Diffstat (limited to 'lib/private/Preview/Storage/Root.php')
-rw-r--r-- | lib/private/Preview/Storage/Root.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/Preview/Storage/Root.php b/lib/private/Preview/Storage/Root.php index a9a72026a51..a284b037b35 100644 --- a/lib/private/Preview/Storage/Root.php +++ b/lib/private/Preview/Storage/Root.php @@ -1,7 +1,6 @@ <?php declare(strict_types=1); - /** * @copyright Copyright (c) 2020, Roeland Jago Douma <roeland@famdouma.nl> * @@ -33,14 +32,25 @@ 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); + if ($this->isMultibucketPreviewDistributionEnabled) { + try { + return parent::getFolder('old-multibucket/' . $internalFolder); + } catch (NotFoundException $e) { + // not in multibucket fallback + } + } + try { return parent::getFolder($internalFolder); } catch (NotFoundException $e) { |