diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/storage.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/storage.php b/lib/storage.php index 51cf6b66..c7fa35b0 100644 --- a/lib/storage.php +++ b/lib/storage.php @@ -139,11 +139,29 @@ class Storage { Db\Session::cleanUp($session->getEsId()); } + private static function processDocuments($rawDocuments){ + $documents = array(); + foreach($rawDocuments as $rawDocument){ + $document = array( + 'fileid' => $rawDocument->getId(), + 'path' => $rawDocument->getInternalPath(), + 'name' => $rawDocument->getName(), + 'mimetype' => $rawDocument->getMimetype() + ); + + array_push($documents, $document); + } + + return $documents; + } + protected static function searchDocuments(){ $documents = array(); foreach (self::getSupportedMimetypes() as $mime){ - $documents = array_merge($documents, \OCP\Files::searchByMime($mime)); + $rawDocuments = \OCP\Files::searchByMime($mime); + $documents = array_merge($documents, self::processDocuments($rawDocuments)); } + return $documents; } |