File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
api_server/routes/internal Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -58,8 +58,13 @@ async def get_files(request: web.Request) -> web.Response:
5858 return web .json_response ({"error" : "Invalid directory type" }, status = 400 )
5959
6060 directory = get_directory_by_type (directory_type )
61+
62+ def is_visible_file (entry : os .DirEntry ) -> bool :
63+ """Filter out hidden files (e.g., .DS_Store on macOS)."""
64+ return entry .is_file () and not entry .name .startswith ('.' )
65+
6166 sorted_files = sorted (
62- (entry for entry in os .scandir (directory ) if entry . is_file ( )),
67+ (entry for entry in os .scandir (directory ) if is_visible_file ( entry )),
6368 key = lambda entry : - entry .stat ().st_mtime
6469 )
6570 return web .json_response ([entry .name for entry in sorted_files ], status = 200 )
You can’t perform that action at this time.
0 commit comments