@@ -249,7 +249,7 @@ public function getRecentFiles() {
249249 * @param \OCP\Files\Node[] $nodes
250250 * @param int $depth The depth to traverse into the contents of each node
251251 */
252- private function getChildren (array $ nodes , int $ depth = 1 , int $ currentDepth = 0 ): array {
252+ private function getChildren (array $ nodes , int $ depth = 1 , int $ currentDepth = 0 , string $ mimeTypeFilter = '' ): array {
253253 if ($ currentDepth >= $ depth ) {
254254 return [];
255255 }
@@ -264,7 +264,7 @@ private function getChildren(array $nodes, int $depth = 1, int $currentDepth = 0
264264 $ entry = [
265265 'id ' => $ node ->getId (),
266266 'basename ' => $ basename ,
267- 'children ' => $ this ->getChildren ($ node ->getDirectoryListing (), $ depth , $ currentDepth + 1 ),
267+ 'children ' => $ this ->getChildren ($ node ->getDirectoryListing ($ mimeTypeFilter ), $ depth , $ currentDepth + 1 ),
268268 ];
269269 $ displayName = $ node ->getName ();
270270 if ($ basename !== $ displayName ) {
@@ -308,8 +308,8 @@ public function getFolderTree(string $path = '/', int $depth = 1): JSONResponse
308308 'message ' => $ this ->l10n ->t ('Invalid folder path ' ),
309309 ], Http::STATUS_BAD_REQUEST );
310310 }
311- $ nodes = $ node ->getDirectoryListing ();
312- $ tree = $ this ->getChildren ($ nodes , $ depth );
311+ $ nodes = $ node ->getDirectoryListing (' httpd/unix-directory ' );
312+ $ tree = $ this ->getChildren ($ nodes , $ depth, 0 , ' httpd/unix-directory ' );
313313 } catch (NotFoundException $ e ) {
314314 return new JSONResponse ([
315315 'message ' => $ this ->l10n ->t ('Folder not found ' ),
0 commit comments