@@ -130,10 +130,21 @@ def recursive_search_models_(self, directory: str, pathIndex: int) -> tuple[list
130
130
131
131
for file_name in filenames :
132
132
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." )
137
148
continue
138
149
139
150
for d in subdirs :
@@ -144,7 +155,7 @@ def recursive_search_models_(self, directory: str, pathIndex: int) -> tuple[list
144
155
logging .warning (f"Warning: Unable to access { path } . Skipping this path." )
145
156
continue
146
157
147
- return [{ "name" : f , "pathIndex" : pathIndex } for f in result ] , dirs , time .perf_counter ()
158
+ return result , dirs , time .perf_counter ()
148
159
149
160
def get_model_previews (self , filepath : str ) -> list [str | BytesIO ]:
150
161
dirname = os .path .dirname (filepath )
0 commit comments