This commit is contained in:
2026-05-18 07:04:08 +02:00
parent 52f04c2839
commit 07e6a9c374
8 changed files with 254 additions and 99 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
import os
import unicodedata
from datetime import datetime
@@ -18,8 +19,8 @@ def scan_files(root_path: str) -> dict:
stat = os.stat(full_path)
except (FileNotFoundError, PermissionError):
continue
rel_path = os.path.relpath(full_path, root_path).replace("\\", "/")
rel_dir = os.path.relpath(root, root_path).replace("\\", "/")
rel_path = unicodedata.normalize("NFC", os.path.relpath(full_path, root_path).replace("\\", "/"))
rel_dir = unicodedata.normalize("NFC", 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)