reuse known parentId when inserting cache entries in scanner

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2020-02-14 22:08:13 +01:00
parent 5439469b68
commit 3fb32f6f3d
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
2 changed files with 4 additions and 1 deletions

View File

@ -274,7 +274,9 @@ class Cache implements ICache {
}
$data['path'] = $file;
if (!isset($data['parent'])) {
$data['parent'] = $this->getParentId($file);
}
$data['name'] = basename($file);
[$values, $extensionValues] = $this->normalizeData($data);

View File

@ -220,6 +220,7 @@ class Scanner extends BasicEmitter implements IScanner {
if (!empty($newData)) {
// Reset the checksum if the data has changed
$newData['checksum'] = '';
$newData['parent'] = $parentId;
$data['fileid'] = $this->addToCache($file, $newData, $fileId);
}
if (isset($cacheData['size'])) {