From d67efd353fdda98d1c40fc9a9af018099268f97e Mon Sep 17 00:00:00 2001 From: ethanfel Date: Fri, 2 Jan 2026 18:18:47 +0100 Subject: [PATCH] Update utils.py --- utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils.py b/utils.py index a370ac5..c3314f8 100644 --- a/utils.py +++ b/utils.py @@ -91,6 +91,14 @@ def save_json(path, data): with open(path, 'w') as f: json.dump(data, f, indent=4) +# --- MISSING FUNCTION RESTORED HERE --- +def get_file_mtime(path): + """Returns the modification time of a file, or 0 if it doesn't exist.""" + path = Path(path) + if path.exists(): + return path.stat().st_mtime + return 0 + def generate_templates(current_dir): """Creates dummy template files if folder is empty.""" save_json(current_dir / "template_i2v.json", DEFAULTS)