Commit 8734747e authored by Merlijn Wajer's avatar Merlijn Wajer
Browse files

scandata: return proper page numbers for single page xml

parent dc680c36
......@@ -65,7 +65,11 @@ def scandata_get_page_count(scandata):
Return the number of page elements in a parsed scandata object
return len(scandata.get('book', {}).get('pageData', {}).get('page', []))
pages = scandata.get('book', {}).get('pageData', {}).get('page', [])
if not isinstance(pages, list):
pages = [pages]
return len(pages)
def scandata_get_skip_pages(scandata):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment