Fix UnboundLocalError by moving extract_cmd definition before printing it

This commit is contained in:
2026-06-29 08:26:25 -04:00
parent c653bd1eed
commit 110fbecbe7
+1 -1
View File
@@ -326,7 +326,6 @@ def run_upscale_pipeline(job: UpscaleJob, on_progress_update: Callable[[str, Dic
if not skip_extraction: if not skip_extraction:
job.update_status("extracting", progress=10) job.update_status("extracting", progress=10)
on_progress_update(job.job_id, {"status": "extracting", "progress": 10}) on_progress_update(job.job_id, {"status": "extracting", "progress": 10})
print(f"[{time.strftime('%Y-%m-%d %H:%M:%S')}] [Job {job.job_id}] extracting frames. Command: {' '.join(extract_cmd)}")
# High quality JPG frames to balance disk usage and speed # High quality JPG frames to balance disk usage and speed
extract_cmd = ["ffmpeg", "-y"] extract_cmd = ["ffmpeg", "-y"]
@@ -345,6 +344,7 @@ def run_upscale_pipeline(job: UpscaleJob, on_progress_update: Callable[[str, Dic
os.path.join(input_frames_dir, "frame_%08d.jpg") os.path.join(input_frames_dir, "frame_%08d.jpg")
]) ])
print(f"[{time.strftime('%Y-%m-%d %H:%M:%S')}] [Job {job.job_id}] extracting frames. Command: {' '.join(extract_cmd)}")
p_extract = job.run_command(extract_cmd) p_extract = job.run_command(extract_cmd)
stdout, stderr = p_extract.communicate() stdout, stderr = p_extract.communicate()
job.cleanup_process(p_extract) job.cleanup_process(p_extract)