mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-21 13:02:40 +00:00
Chore: document the page numbering in zone OCR
This commit is contained in:
1 parent
ad64f2a1b1
commit
6b8b946567
2 files changed
+8
-2
No files matched your search
@@ -439,7 +439,10 @@ def zone_results_written(results: list[ZoneOcrResult]) -> bool:
|
||||
|
||||
|
||||
def _resolve_page_idx(page_value: int | None, page_count: int | None) -> int:
|
||||
"""Resolve a 1-based page or -1 (last page), defaulting to the first page."""
|
||||
"""
|
||||
Resolve a zone's 1-based page or -1 (last page) to a 0-based index, defaulting
|
||||
to the first page. Without a page count, the last page resolves to the first.
|
||||
"""
|
||||
if page_value == -1:
|
||||
return max((page_count or 1) - 1, 0)
|
||||
return max((page_value or 1) - 1, 0)
|
||||
|
||||
Reference in new issue
Block a user