Retain captions already produced by the selected model

This commit is contained in:
Sleeps
2026-10-06 15:05:41 +01:00
parent aa9405d5f6
commit e715d06677
+26 -7
View File
@@ -433,11 +433,31 @@ def cmd_caption(args: argparse.Namespace) -> None:
)
general_rows = [
item for item in routed if item[1] == "general"
item
for item in routed
if item[1] == "general"
and (
args.force
or item[0]["caption"] is None
or item[0]["caption_model"] != settings.caption_general_model
)
]
specialist_rows = [
item for item in routed if item[1] == "specialist"
item
for item in routed
if item[1] == "specialist"
and (
args.force
or item[0]["caption"] is None
or item[0]["caption_model"] != settings.caption_specialist_model
)
]
retained = len(routed) - len(general_rows) - len(specialist_rows)
if retained:
print(
f"Keeping {retained} existing caption(s) because they already use "
f"the model selected by the router."
)
print(f"General prompt: {settings.caption_prompt_file}")
print(f"Specialist prompt: {settings.caption_specialist_prompt_file}")
@@ -460,11 +480,10 @@ def cmd_caption(args: argparse.Namespace) -> None:
failed = general_failed + specialist_failed + missing
print(f"\nCaptioning complete: {completed} saved, {failed} failed/skipped.")
if completed:
if args.sync:
cmd_sync_meili(args)
else:
print("Next: python -m scene_search.cli sync-meili")
if args.sync:
cmd_sync_meili(args)
elif completed:
print("Next: python -m scene_search.cli sync-meili")
def cmd_status(_: argparse.Namespace) -> None: