Phase 3: fix page_count in transcript processor

Set page_count on documents row during pre_flight. Without this,
enricher comparison `page_count >= 3` fails with TypeError on NULL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt 2026-04-14 15:43:21 +00:00
commit f69c04a0e3

View file

@ -132,11 +132,11 @@ def pre_flight(content_path, meta_path, db, config):
# Queue and advance to extracted
db.queue_document(file_hash)
# Set text_dir on the documents row
# Set text_dir and page_count on the documents row
conn = db._get_conn()
conn.execute(
"UPDATE documents SET text_dir = ? WHERE hash = ?",
(proc_dir, file_hash)
"UPDATE documents SET text_dir = ?, page_count = ? WHERE hash = ?",
(proc_dir, len(pages), file_hash)
)
conn.commit()