From 1374cbee3e5d44ecec0a0784b3ab3a5afcc0d2ac Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 13 Apr 2022 16:05:45 +0200 Subject: store unencrypted size in the unencrypted_size column Signed-off-by: Robin Appelman --- lib/private/Files/Cache/CacheEntry.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/private/Files/Cache/CacheEntry.php') diff --git a/lib/private/Files/Cache/CacheEntry.php b/lib/private/Files/Cache/CacheEntry.php index 12f0273fb6e..8ac76acf6d1 100644 --- a/lib/private/Files/Cache/CacheEntry.php +++ b/lib/private/Files/Cache/CacheEntry.php @@ -132,4 +132,12 @@ class CacheEntry implements ICacheEntry { public function __clone() { $this->data = array_merge([], $this->data); } + + public function getUnencryptedSize(): int { + if (isset($this->data['unencrypted_size']) && $this->data['unencrypted_size'] > 0) { + return $this->data['unencrypted_size']; + } else { + return $this->data['size']; + } + } } -- cgit v1.2.3