summaryrefslogtreecommitdiffstats
path: root/lib/private/Preview
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-08-07 16:02:02 +0200
committerGitHub <noreply@github.com>2020-08-07 16:02:02 +0200
commit408ed7ebd4c8da989fdbd45024cdec2e52a1f35c (patch)
tree23ff3995e5f12c061f02e6ead1f6fff2e6555e1c /lib/private/Preview
parentd12dd3370eff809c729e8fd9548ab63161971731 (diff)
parent4d0c3fa4a8408f1019a6c934d42fe72f1b23dcfb (diff)
downloadnextcloud-server-408ed7ebd4c8da989fdbd45024cdec2e52a1f35c.tar.gz
nextcloud-server-408ed7ebd4c8da989fdbd45024cdec2e52a1f35c.zip
Merge pull request #22139 from nextcloud/fix/noid/check-for-preview-multibucket-fallback-as-second-step
Check previews in multibucket fallback folder as the last step and not as first step
Diffstat (limited to 'lib/private/Preview')
-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 2a3367b83b7..2df90fa5a05 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 = self::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 {