mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 06:50:53 +00:00
fix: add ocr_redo property to Base file properties section
This commit is contained in:
parent
f2bee97a0a
commit
73c99883d2
1 changed files with 11 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue