aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichaIng <micha@dietpi.com>2021-08-21 02:13:30 +0200
committerGitHub <noreply@github.com>2021-08-21 02:13:30 +0200
commit664a95eb75fc97cc2b68dd77244b09e1931b0fc2 (patch)
treebdbda15760f8546ae7bd3e3e7952612440405a57
parent648ae408e93f4fe720ef3a4f1e4cfe764c71aac2 (diff)
parent951aa784b071151cc92f6918f357d79bb50f75ad (diff)
downloadnextcloud-server-664a95eb75fc97cc2b68dd77244b09e1931b0fc2.tar.gz
nextcloud-server-664a95eb75fc97cc2b68dd77244b09e1931b0fc2.zip
Merge pull request #28534 from nextcloud/backport/28185/stable22
[stable22] Fix folder size contained in S3 buckets
-rw-r--r--apps/files_external/lib/Lib/Storage/AmazonS3.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php
index 32e74250a91..220822f9396 100644
--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -384,13 +384,14 @@ class AmazonS3 extends \OC\Files\Storage\Common {
try {
$stat = [];
if ($this->is_dir($path)) {
- //folders don't really exist
- $stat['size'] = -1; //unknown
- $stat['mtime'] = time();
$cacheEntry = $this->getCache()->get($path);
- if ($cacheEntry instanceof CacheEntry && $this->getMountOption('filesystem_check_changes', 1) !== 1) {
+ if ($cacheEntry instanceof CacheEntry) {
$stat['size'] = $cacheEntry->getSize();
$stat['mtime'] = $cacheEntry->getMTime();
+ } else {
+ // Use dummy values
+ $stat['size'] = -1; // Pending
+ $stat['mtime'] = time();
}
} else {
$stat['size'] = $this->getContentLength($path);
@@ -405,6 +406,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
}
}
+ public function hasUpdated($path, $time) {
+ return $this->getMountOption('filesystem_check_changes', 1) === 1 || parent::hasUpdated($path, $time);
+ }
+
/**
* Return content length for object
*