fixed postFileSize
This commit is contained in:
parent
5cd14425f9
commit
1deeec93b7
|
@ -465,15 +465,21 @@ class Proxy extends \OC_FileProxy
|
|||
return $size;
|
||||
}
|
||||
|
||||
// get file info from database/cache
|
||||
$fileInfo = \OC\Files\Filesystem::getFileInfo($path_f);
|
||||
$fileInfo = false;
|
||||
// get file info from database/cache if not .part file
|
||||
if(!Keymanager::isPartialFilePath($path)) {
|
||||
$fileInfo = $view->getFileInfo($path);
|
||||
}
|
||||
|
||||
// if file is encrypted return real file size
|
||||
if (is_array($fileInfo) && $fileInfo['encrypted'] === true) {
|
||||
$size = $fileInfo['unencrypted_size'];
|
||||
} else {
|
||||
// self healing if file was removed from file cache
|
||||
if (is_array($fileInfo)) {
|
||||
if (!is_array($fileInfo)) {
|
||||
$fileInfo = array();
|
||||
}
|
||||
|
||||
$userId = \OCP\User::getUser();
|
||||
$util = new Util($view, $userId);
|
||||
$fixSize = $util->getFileSize($path);
|
||||
|
@ -483,10 +489,12 @@ class Proxy extends \OC_FileProxy
|
|||
$fileInfo['encrypted'] = true;
|
||||
$fileInfo['unencrypted_size'] = $size;
|
||||
|
||||
// put file info
|
||||
// put file info if not .part file
|
||||
if(!Keymanager::isPartialFilePath($path_f)) {
|
||||
$view->putFileInfo($path, $fileInfo);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return $size;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue