@@ -1471,10 +1471,10 @@ public function addSubMounts(FileInfo $info, $extOnly = false): void {
14711471 * get the content of a directory
14721472 *
14731473 * @param string $directory path under datadirectory
1474- * @param string $mimetype_filter limit returned content to this mimetype or mimepart
1474+ * @param string $mimeTypeFilter limit returned content to this mimetype or mimepart
14751475 * @return FileInfo[]
14761476 */
1477- public function getDirectoryContent ($ directory , $ mimetype_filter = '' , ?\OCP \Files \FileInfo $ directoryInfo = null ) {
1477+ public function getDirectoryContent (string $ directory , string $ mimeTypeFilter = '' , ?\OCP \Files \FileInfo $ directoryInfo = null ) {
14781478 $ this ->assertPathLength ($ directory );
14791479 if (!Filesystem::isValidPath ($ directory )) {
14801480 return [];
@@ -1506,7 +1506,7 @@ public function getDirectoryContent($directory, $mimetype_filter = '', ?\OCP\Fil
15061506 }
15071507
15081508 $ folderId = $ data ->getId ();
1509- $ contents = $ cache ->getFolderContentsById ($ folderId); //TODO: mimetype_filter
1509+ $ contents = $ cache ->getFolderContentsById ($ folderId, $ mimeTypeFilter );
15101510
15111511 $ sharingDisabled = \OCP \Util::isSharingDisabledForUser ();
15121512 $ permissionsMask = ~\OCP \Constants::PERMISSION_SHARE ;
@@ -1632,12 +1632,12 @@ public function getDirectoryContent($directory, $mimetype_filter = '', ?\OCP\Fil
16321632 }
16331633 }
16341634
1635- if ($ mimetype_filter ) {
1636- $ files = array_filter ($ files , function (FileInfo $ file ) use ($ mimetype_filter ) {
1637- if (strpos ($ mimetype_filter , '/ ' )) {
1638- return $ file ->getMimetype () === $ mimetype_filter ;
1635+ if ($ mimeTypeFilter ) {
1636+ $ files = array_filter ($ files , function (FileInfo $ file ) use ($ mimeTypeFilter ) {
1637+ if (strpos ($ mimeTypeFilter , '/ ' )) {
1638+ return $ file ->getMimetype () === $ mimeTypeFilter ;
16391639 } else {
1640- return $ file ->getMimePart () === $ mimetype_filter ;
1640+ return $ file ->getMimePart () === $ mimeTypeFilter ;
16411641 }
16421642 });
16431643 }
0 commit comments