Skip to content
Snippets Groups Projects
Commit 5bbc583b authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

Merge pull request #3532 from owncloud/scan-update

Only update metadata that has changed
parents 8a5dec77 ea553676
Branches
No related tags found
No related merge requests found
......@@ -78,18 +78,21 @@ class Scanner {
$this->scanFile($parent);
}
}
$newData = $data;
if ($cacheData = $this->cache->get($file)) {
if ($checkExisting && $data['size'] === -1) {
$data['size'] = $cacheData['size'];
}
if ($data['mtime'] === $cacheData['mtime'] &&
$data['size'] === $cacheData['size']) {
$data['etag'] = $cacheData['etag'];
}
// Only update metadata that has changed
$newData = array_diff($data, $cacheData);
}
if ($checkExisting and $cacheData) {
if ($data['size'] === -1) {
$data['size'] = $cacheData['size'];
}
if (!empty($newData)) {
$this->cache->put($file, $newData);
}
$this->cache->put($file, $data);
}
return $data;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment