From 3e1eb9addd632f702579f7ff8d7ef1254a5ee5e0 Mon Sep 17 00:00:00 2001 From: Sleeps Date: Wed, 7 Oct 2026 14:26:37 +0100 Subject: [PATCH] Index unsynced caption frames --- scene_search/database.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scene_search/database.py b/scene_search/database.py index dd59ae1..62e2767 100644 --- a/scene_search/database.py +++ b/scene_search/database.py @@ -115,6 +115,13 @@ def _ensure_frame_caption_columns(con: sqlite3.Connection) -> None: for name, sql_type in additions.items(): if name not in columns: con.execute(f"ALTER TABLE frames ADD COLUMN {name} {sql_type}") + con.execute( + """ + CREATE INDEX IF NOT EXISTS idx_frames_unsynced_caption + ON frames(meili_synced_at) + WHERE caption IS NOT NULL + """ + ) def init_db(path: Path) -> None: