diff --git a/requirements.txt b/requirements.txt index 4b57be2..5693f7d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -nc-py-api[app]==0.23.1 -ocrmypdf==16.13.0 +nc-py-api[app]==0.30.1 +ocrmypdf==17.4.2 python-multipart==0.0.20 \ No newline at end of file diff --git a/test/test_app.py b/test/test_app.py index 072a938..63f92fb 100644 --- a/test/test_app.py +++ b/test/test_app.py @@ -58,7 +58,7 @@ def test_process_ocr_error_already_processed_file(): assert response.status_code == 500 response_json = response.json() assert "message" in response_json - assert response_json["message"] == "page already has text! - aborting (use --force-ocr to force OCR; see also help for the arguments --skip-text and --redo-ocr (PriorOcrFoundError)" + assert response_json["message"] == "page already has text! - aborting (use --force-ocr or --mode force to force OCR; see also help for --skip-text, --redo-ocr, and --mode) (PriorOcrFoundError)" assert "ocrMyPdfExitCode" in response_json assert response_json["ocrMyPdfExitCode"] == 6 diff --git a/workflow_ocr_backend/app.py b/workflow_ocr_backend/app.py index ac5321a..1e30bbc 100644 --- a/workflow_ocr_backend/app.py +++ b/workflow_ocr_backend/app.py @@ -24,7 +24,7 @@ async def lifespan(app: FastAPI): logger = logging.getLogger('uvicorn.error') # Use same logging as uvicorn -def enabled_handler(enabled: bool, _: NextcloudApp | AsyncNextcloudApp) -> str: +async def enabled_handler(enabled: bool, _: AsyncNextcloudApp) -> str: # Nothing to do currently ... logger.debug(f"App enabled: {enabled}") return "" diff --git a/workflow_ocr_backend/ocrservice.py b/workflow_ocr_backend/ocrservice.py index 448ea64..dfe855f 100644 --- a/workflow_ocr_backend/ocrservice.py +++ b/workflow_ocr_backend/ocrservice.py @@ -57,7 +57,7 @@ def _split_parameters(self, ocrmypdf_parameters: str) -> dict[str, str | bool | if not param: continue splitted_param = [p.strip() for p in param.split(" ")] - key = splitted_param[0] + key = splitted_param[0].replace("-", "_") length = len(splitted_param) if length >= 2: value = splitted_param[1]