From 12bccaa6313595db872e8047f93559cdeb8feaab Mon Sep 17 00:00:00 2001 From: Holden Date: Sat, 13 Jun 2026 05:14:15 +0000 Subject: [PATCH] Fix TypeError when worst mapped file is None in quality replacement When no mapped files exist for a person, worst is None and the old f-string tried to subscript it before the conditional was evaluated. Extracted worst_score_str as a local variable to avoid the crash. Co-Authored-By: Claude Sonnet 4.6 --- winnow/executor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winnow/executor.py b/winnow/executor.py index 36250dd..5e2f4b3 100644 --- a/winnow/executor.py +++ b/winnow/executor.py @@ -338,9 +338,10 @@ def upload_to_frigate(jobs: list[dict]) -> None: continue worst = get_lowest_quality_mapped_file(name) if worst is None or new_score <= worst[2]: + worst_score_str = f"{worst[2]:.3f}" if worst is not None else "N/A" progress.console.print( f" [dim]⏭ {fname}: score {new_score:.3f} ≤ worst mapped" - f" {worst[2]:.3f if worst else 'N/A'}, skipping[/dim]" + f" {worst_score_str}, skipping[/dim]" ) progress.advance(upload_task) continue