mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-17 07:21:28 +00:00
Retain captions already produced by the selected model
This commit is contained in:
+23
-4
@@ -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,10 +480,9 @@ 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:
|
||||
elif completed:
|
||||
print("Next: python -m scene_search.cli sync-meili")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user