respect settings.skip_archive_file before OCR fails

This commit is contained in:
Ben Greiner 2025-02-14 18:34:56 +01:00 committed by GitHub
parent a9ef7ff58e
commit 71d7a8ab0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -378,13 +378,13 @@ class RasterisedDocumentParser(DocumentParser):
sidecar_file,
)
if self.settings.skip_archive_file != ArchiveFileChoices.ALWAYS:
self.archive_path = archive_path
try:
self.log.debug(f"Calling OCRmyPDF with args: {args}")
ocrmypdf.ocr(**args)
if self.settings.skip_archive_file != ArchiveFileChoices.ALWAYS:
self.archive_path = archive_path
self.text = self.extract_text(sidecar_file, archive_path)
if not self.text: