only update the values which really changed

This commit is contained in:
Bjoern Schiessle 2014-04-30 12:48:16 +02:00
parent 6b02126dc1
commit 57b671ebec
1 changed files with 6 additions and 8 deletions

View File

@ -340,26 +340,24 @@ class Proxy extends \OC_FileProxy {
$fileInfo['unencrypted_size'] = $fixSize;
// put file info if not .part file
if (!Helper::isPartialFilePath($relativePath)) {
$view->putFileInfo($path, $fileInfo);
$view->putFileInfo($path, array('unencrypted_size' => $fixSize));
}
}
$size = $fileInfo['unencrypted_size'];
} else {
// self healing if file was removed from file cache
if (!$fileInfo) {
$fileInfo = array();
}
$fileInfoUpdates = array();
$fixSize = $util->getFileSize($path);
if ($fixSize > 0) {
$size = $fixSize;
$fileInfo['encrypted'] = true;
$fileInfo['unencrypted_size'] = $size;
$fileInfoUpdates['encrypted'] = true;
$fileInfoUpdates['unencrypted_size'] = $size;
// put file info if not .part file
if (!Helper::isPartialFilePath($relativePath)) {
$view->putFileInfo($path, $fileInfo);
$view->putFileInfo($path, $fileInfoUpdates);
}
}