z230
This commit is contained in:
@@ -20,11 +20,14 @@ def scan_files(root_path: str) -> dict:
|
||||
continue
|
||||
rel_path = os.path.relpath(full_path, root_path).replace("\\", "/")
|
||||
rel_dir = os.path.relpath(root, root_path).replace("\\", "/")
|
||||
# Truncate microseconds — MySQL DATETIME rounds to whole seconds,
|
||||
# which causes false "modified" detections on every run.
|
||||
mtime = datetime.fromtimestamp(stat.st_mtime).replace(microsecond=0)
|
||||
result[rel_path] = {
|
||||
"full_path": full_path,
|
||||
"file_name": name,
|
||||
"directory": rel_dir,
|
||||
"size": stat.st_size,
|
||||
"mtime": datetime.fromtimestamp(stat.st_mtime),
|
||||
"mtime": mtime,
|
||||
}
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user