@@ -30,11 +30,14 @@ public function __construct(
3030		$ this noteUtil  = $ noteUtil
3131	}
3232
33- 	public  function  getAll (string  $ userIdbool  $ autoCreateNotesFolderfalse ) : array  {
33+ 	public  function  getAll (string  $ userIdbool  $ autoCreateNotesFolderfalse , ? bool   $ showHidden  =  null ) : array  {
3434		$ customExtension$ this getCustomExtension ($ userId
3535		try  {
3636			$ notesFolder$ this getNotesFolder ($ userId$ autoCreateNotesFolder
37- 			$ dataself ::gatherNoteFiles ($ customExtension$ notesFolder
37+ 			if  ($ showHiddennull ) {
38+ 				$ showHidden$ this settings ->get ($ userId'showHidden ' );
39+ 			}
40+ 			$ dataself ::gatherNoteFiles ($ customExtension$ notesFolder$ showHidden
3841			$ fileIdsarray_keys ($ data'files ' ]);
3942			// pre-load tags for all notes (performance improvement) 
4043			$ this noteUtil ->getTagService ()->loadTags ($ fileIds
@@ -66,7 +69,8 @@ public function countNotes(string $userId) : int {
6669		$ customExtension$ this getCustomExtension ($ userId
6770		try  {
6871			$ notesFolder$ this getNotesFolder ($ userIdfalse );
69- 			$ dataself ::gatherNoteFiles ($ customExtension$ notesFolder
72+ 			$ showHidden$ this settings ->get ($ userId'showHidden ' );
73+ 			$ dataself ::gatherNoteFiles ($ customExtension$ notesFolder$ showHidden
7074			return  count ($ data'files ' ]);
7175		} catch  (NotesFolderException $ e
7276			return  0 ;
@@ -168,6 +172,7 @@ private function getNotesFolder(string $userId, bool $create = true) : Folder {
168172	private  static  function  gatherNoteFiles (
169173		string  $ customExtension
170174		Folder $ folder
175+ 		bool  $ showHidden
171176		string  $ categoryPrefix'' ,
172177	) : array  {
173178		$ data
@@ -176,10 +181,14 @@ private static function gatherNoteFiles(
176181		];
177182		$ nodes$ foldergetDirectoryListing ();
178183		foreach  ($ nodesas  $ node
184+ 			$ hiddenstr_starts_with ($ nodegetName (), '. ' );
185+ 			if  ($ hidden$ showHidden
186+ 				continue ;
187+ 			}
179188			if  ($ nodegetType () === FileInfo::TYPE_FOLDER  && $ nodeinstanceof  Folder) {
180189				$ subCategory$ categoryPrefix$ nodegetName ();
181190				$ data'categories ' ][] = $ subCategory
182- 				$ data_subself ::gatherNoteFiles ($ customExtension$ node$ subCategory'/ ' );
191+ 				$ data_subself ::gatherNoteFiles ($ customExtension$ node$ showHidden ,  $ subCategory'/ ' );
183192				$ data'files ' ] = $ data'files ' ] + $ data_sub'files ' ];
184193				$ data'categories ' ] = $ data'categories ' ] + $ data_sub'categories ' ];
185194			} elseif  (self ::isNote ($ node$ customExtension
0 commit comments