aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-08-07 09:32:31 +0200
committerMorris Jobke <hey@morrisjobke.de>2020-08-07 09:37:11 +0200
commit4d0c3fa4a8408f1019a6c934d42fe72f1b23dcfb (patch)
tree0ff63b3c31449ed3502f62066f525b70c12eda0c /lib
parenteb2b1bec85fe344a0a0bad57dfd4a744b6fcbd20 (diff)
downloadnextcloud-server-4d0c3fa4a8408f1019a6c934d42fe72f1b23dcfb.tar.gz
nextcloud-server-4d0c3fa4a8408f1019a6c934d42fe72f1b23dcfb.zip
Check previews in multibucket fallback folder as the last step and not as first step
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Preview/Storage/Root.php23
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/private/Preview/Storage/Root.php b/lib/private/Preview/Storage/Root.php
index a284b037b35..a2efc8196a8 100644
--- a/lib/private/Preview/Storage/Root.php
+++ b/lib/private/Preview/Storage/Root.php
@@ -43,14 +43,6 @@ class Root extends AppData {
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) {
@@ -60,7 +52,20 @@ class Root extends AppData {
*/
}
- return parent::getFolder($name);
+ try {
+ return parent::getFolder($name);
+ } catch (NotFoundException $e) {
+ /*
+ * The old folder structure is not found.
+ * Lets try the multibucket fallback if available
+ */
+ if ($this->isMultibucketPreviewDistributionEnabled) {
+ return parent::getFolder('old-multibucket/' . $internalFolder);
+ }
+
+ // when there is no further fallback just throw the exception
+ throw $e;
+ }
}
public function newFolder(string $name): ISimpleFolder {