diff --git a/scene_search/cli.py b/scene_search/cli.py index 374211e..d106e67 100644 --- a/scene_search/cli.py +++ b/scene_search/cli.py @@ -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: