summaryrefslogtreecommitdiffstats
path: root/lib/private/files/cache/scanner.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/cache/scanner.php')
-rw-r--r--lib/private/files/cache/scanner.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php
index 92a4c01841b..79159724d16 100644
--- a/lib/private/files/cache/scanner.php
+++ b/lib/private/files/cache/scanner.php
@@ -155,7 +155,7 @@ class Scanner extends BasicEmitter {
}
}
if (!empty($newData)) {
- $this->cache->put($file, $newData);
+ $data['fileid'] = $this->cache->put($file, $newData);
$this->emit('\OC\Files\Cache\Scanner', 'postScanFile', array($file, $this->storageId));
\OC_Hook::emit('\OC\Files\Cache\Scanner', 'post_scan_file', array('path' => $file, 'storage' => $this->storageId));
}
@@ -173,14 +173,16 @@ class Scanner extends BasicEmitter {
* @param string $path
* @param bool $recursive
* @param int $reuse
- * @return int the size of the scanned folder or -1 if the size is unknown at this stage
+ * @return array with the meta data of the scanned file or folder
*/
public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1) {
if ($reuse === -1) {
$reuse = ($recursive === self::SCAN_SHALLOW) ? self::REUSE_ETAG | self::REUSE_SIZE : 0;
}
- $this->scanFile($path, $reuse);
- return $this->scanChildren($path, $recursive, $reuse);
+ $data = $this->scanFile($path, $reuse);
+ $size = $this->scanChildren($path, $recursive, $reuse);
+ $data['size'] = $size;
+ return $data;
}
/**