fix: add ocr_redo property to Base file properties section

This commit is contained in:
Research Assistant 2026-06-01 11:43:17 +08:00
parent f2bee97a0a
commit 73c99883d2

View file

@ -239,6 +239,8 @@ def merge_base_views(existing_content: str | None, new_views: list[dict], folder
displayName: "Analyze"
ocr_status:
displayName: "OCR Status"
ocr_redo:
displayName: "重做OCR"
deep_reading_status:
displayName: "Deep Reading"
pdf_path:
@ -412,6 +414,8 @@ properties:
displayName: "Analyze"
ocr_status:
displayName: "OCR Status"
ocr_redo:
displayName: "重做OCR"
deep_reading_status:
displayName: "Deep Reading"
pdf_path:
@ -472,6 +476,13 @@ def ensure_base_views(vault: Path, paths: dict[str, Path], config: dict, force:
if v["name"] in missing:
updated += "\n" + _render_single_pf_view(v)
# Check for missing properties (e.g. ocr_redo)
if " ocr_redo:" not in updated and "properties:" in updated:
updated = updated.replace(
" ocr_status:\n displayName: \"OCR Status\"",
" ocr_status:\n displayName: \"OCR Status\"\n ocr_redo:\n displayName: \"重做OCR\""
)
if updated != existing:
base_path.write_text(updated, encoding="utf-8")
return