Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CarnetApp/CarnetNextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhie <phie@phie.ovh>2019-04-17 15:54:09 +0300
committerPhie <phie@phie.ovh>2019-04-17 15:54:09 +0300
commit8d34b338749d10d040780ad21b96c27bb6b5bd3f (patch)
tree7bda54ba29b278ea203933dcbd88c904b5a826bf /lib/Controller/NoteController.php
parent712e9161c1a2627661b7bb6d8550295c295a3c02 (diff)
send metadata with file list
Diffstat (limited to 'lib/Controller/NoteController.php')
-rwxr-xr-xlib/Controller/NoteController.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/Controller/NoteController.php b/lib/Controller/NoteController.php
index 6d2bdf2..329dedc 100755
--- a/lib/Controller/NoteController.php
+++ b/lib/Controller/NoteController.php
@@ -61,7 +61,7 @@
$path = "";
else if(substr($path, -1) !== '/' && !empty($path))
$path .= "/";
-
+ $paths = array();
$data = array();
foreach($this->CarnetFolder->get($path)->getDirectoryListing() as $in){
$inf = $in->getFileInfo();
@@ -70,10 +70,20 @@
$file['path'] = $path.$inf->getName();
$file['isDir'] = $inf->getType() === "dir";
$file['mtime'] = $inf->getMtime();
+ if($inf->getType() !== "dir"){
+ array_push($paths, $file['path']);
+ }
array_push($data,$file);
}
-
- return $data;
+
+ $return = array();
+ if(sizeof($paths)>0){
+ $cache = new CacheManager($this->db, $this->CarnetFolder);
+ $metadataFromCache = $cache->getFromCache($paths);
+ $return['metadata'] = $metadataFromCache;
+ }
+ $return['files'] = $data;
+ return $return;
}
/*
@@ -131,10 +141,10 @@
array_push($paths, $path);
}
+ $return = array();
if(sizeof($paths)>0){
$cache = new CacheManager($this->db, $this->CarnetFolder);
$metadataFromCache = $cache->getFromCache($paths);
- $return = array();
$return['metadata'] = $metadataFromCache;
}