From 5dab5fd68c097658fde18c51b23ba2a9a65e4601 Mon Sep 17 00:00:00 2001 From: LEDfan Date: Sat, 20 Dec 2014 11:16:40 +0100 Subject: [PATCH] Use thumbnail cache instead of refreshing every time --- lib/utils/properties.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/utils/properties.php b/lib/utils/properties.php index 18327183..3cc53972 100644 --- a/lib/utils/properties.php +++ b/lib/utils/properties.php @@ -293,12 +293,19 @@ Class Properties { $cache = \OC::$server->getCache(); $key = self::THUMBNAIL_PREFIX . $backendName . '::' . $addressBookId . '::' . $contactId; //$cache->remove($key); - if ($cache->hasKey($key) && $image === null - && (isset($options['remove']) && $options['remove'] === false) - && (isset($options['update']) && $options['update'] === false)) { - return $cache->get($key); + $haskey = $cache->hasKey($key); + + if (!array_key_exists($options, 'remove') && !array_key_exists($options, 'update')){ + if ($cache->hasKey($key) && $image === null){ + return $cache->get($key); + } + } else { + if ($options['remove'] === false && $options['update'] === false){ + return $cache->get($key); + } } + if (isset($options['remove']) && $options['remove']) { $cache->remove($key); if(!isset($options['update']) || !$options['update']) {