@@ -130,10 +130,21 @@ def recursive_search_models_(self, directory: str, pathIndex: int) -> tuple[list
130130
131131 for file_name in filenames :
132132 try :
133- relative_path = os .path .relpath (os .path .join (dirpath , file_name ), directory )
134- result .append (relative_path )
135- except :
136- logging .warning (f"Warning: Unable to access { file_name } . Skipping this file." )
133+ full_path = os .path .join (dirpath , file_name )
134+ relative_path = os .path .relpath (full_path , directory )
135+
136+ # Get file metadata
137+ file_info = {
138+ "name" : relative_path ,
139+ "pathIndex" : pathIndex ,
140+ "modified" : os .path .getmtime (full_path ), # Add modification time
141+ "created" : os .path .getctime (full_path ), # Add creation time
142+ "size" : os .path .getsize (full_path ) # Add file size
143+ }
144+ result .append (file_info )
145+
146+ except Exception as e :
147+ logging .warning (f"Warning: Unable to access { file_name } . Error: { e } . Skipping this file." )
137148 continue
138149
139150 for d in subdirs :
@@ -144,7 +155,7 @@ def recursive_search_models_(self, directory: str, pathIndex: int) -> tuple[list
144155 logging .warning (f"Warning: Unable to access { path } . Skipping this path." )
145156 continue
146157
147- return [{ "name" : f , "pathIndex" : pathIndex } for f in result ] , dirs , time .perf_counter ()
158+ return result , dirs , time .perf_counter ()
148159
149160 def get_model_previews (self , filepath : str ) -> list [str | BytesIO ]:
150161 dirname = os .path .dirname (filepath )
0 commit comments