From 57a66513943f8c231ec5efdda386d63edcaf3b2a Mon Sep 17 00:00:00 2001 From: Arnaud_Cayrol Date: Sat, 12 Apr 2025 22:17:46 +0200 Subject: [PATCH] Cleanup --- main.py | 7 +++---- templates/index.html | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 62b33c5..9528c02 100644 --- a/main.py +++ b/main.py @@ -96,11 +96,11 @@ def background_process( progress_callback=progress_callback, cancel_flag=cancel_flag ) + + if progress_callback: + progress_callback(1, 1) if not do_not_compile_video and not cancel_flag(): - if progress_callback: - progress_callback(0, 1) # Reset progress for video compilation - progress_info["status"] = "compiling_video" video_output_path = os.path.join(config.output_folder, "timelapse.mp4") success = compile_timelapse( @@ -179,7 +179,6 @@ def index() -> str: "total": 0, "status": "idle" }) - progress_info.pop("video_path", None) # Start processing processing_thread = threading.Thread( diff --git a/templates/index.html b/templates/index.html index d882f93..4175f65 100644 --- a/templates/index.html +++ b/templates/index.html @@ -223,7 +223,7 @@ @@ -339,7 +339,7 @@ } // Poll every 1 second - setInterval(fetchProgress, 1000); + setInterval(fetchProgress, 200); // Form submission document.getElementById('timelapseForm').addEventListener('submit', function() {