This commit is contained in:
2026-02-10 10:29:20 +01:00
parent 9838164b88
commit f9082f1e5b
7 changed files with 156 additions and 7 deletions

View File

@@ -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