Fixes the creation of an archive file, even if noarchive was specified

This commit is contained in:
Trenton Holmes
2022-08-20 13:47:56 -07:00
parent 0878a199f4
commit b3b2519bf0
2 changed files with 37 additions and 2 deletions

View File

@@ -276,7 +276,10 @@ class RasterisedDocumentParser(DocumentParser):
self.log("debug", f"Calling OCRmyPDF with args: {args}")
ocrmypdf.ocr(**args)
self.archive_path = archive_path
# Only create archive file if archiving isn't being skipped
if settings.OCR_MODE != "skip_noarchive":
self.archive_path = archive_path
self.text = self.extract_text(sidecar_file, archive_path)
if not self.text: