feat: enhance PDF text extraction and add maintenance features

- Refactor text extraction functions to extract text from all pages instead of just the first page.
- Implement logging for better debugging during file operations.
- Add a new maintenance page with options to rebuild the database and run consistency checks.
- Update styles for maintenance actions and improve UI elements.
- Remove obsolete rebuild database functionality from the main interface.
This commit is contained in:
2026-10-13 22:01:36 +02:00
parent ab232a276f
commit 34271f3bfa
13 changed files with 237 additions and 67 deletions
@@ -37,7 +37,7 @@ import requests
# Add parent directory to path for imports
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from app.extractor import extract_first_page_text
from app.extractor import extract_document_text
from app.sidecar import (
Sidecar,
SidecarStatus,
@@ -826,7 +826,7 @@ class Importer:
# Update sidecar
sidecar.sha256 = sha256
sidecar.extracted_text = extract_first_page_text(pdf_bytes)
sidecar.extracted_text = extract_document_text(pdf_bytes)
# Write sidecar
sidecar_key = get_sidecar_key(target_key)