mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-20 00:33:36 +00:00
Resume captions against the saved route-specific model
This commit is contained in:
+13
-8
@@ -194,18 +194,23 @@ def _select_caption_rows(
|
|||||||
params: list[object] = []
|
params: list[object] = []
|
||||||
|
|
||||||
if only_needing_caption and not getattr(args, "force", False):
|
if only_needing_caption and not getattr(args, "force", False):
|
||||||
expected_models = [
|
conditions.append(
|
||||||
|
"("
|
||||||
|
"f.caption IS NULL OR f.caption_model IS NULL "
|
||||||
|
"OR f.caption_route IS NULL "
|
||||||
|
"OR f.caption_route NOT IN ('general', 'specialist') "
|
||||||
|
"OR (f.caption_route = 'general' AND f.caption_model != ?) "
|
||||||
|
"OR (f.caption_route = 'specialist' AND f.caption_model != ?) "
|
||||||
|
"OR f.route_policy IS NULL OR f.route_policy != ?"
|
||||||
|
")"
|
||||||
|
)
|
||||||
|
params.extend(
|
||||||
|
[
|
||||||
settings.caption_general_model,
|
settings.caption_general_model,
|
||||||
settings.caption_specialist_model,
|
settings.caption_specialist_model,
|
||||||
|
_route_policy(),
|
||||||
]
|
]
|
||||||
placeholders = ",".join("?" for _ in expected_models)
|
|
||||||
conditions.append(
|
|
||||||
f"(f.caption IS NULL OR f.caption_model IS NULL "
|
|
||||||
f"OR f.caption_model NOT IN ({placeholders}) "
|
|
||||||
f"OR f.route_policy IS NULL OR f.route_policy != ?)"
|
|
||||||
)
|
)
|
||||||
params.extend(expected_models)
|
|
||||||
params.append(_route_policy())
|
|
||||||
|
|
||||||
if getattr(args, "media_id", None):
|
if getattr(args, "media_id", None):
|
||||||
conditions.append("f.media_id = ?")
|
conditions.append("f.media_id = ?")
|
||||||
|
|||||||
Reference in New Issue
Block a user