diff --git a/uploader.py b/uploader.py index b965f7a..2bcc79f 100644 --- a/uploader.py +++ b/uploader.py @@ -174,9 +174,9 @@ def fetch_all_books(cfg: CalibreConfig) -> list[dict]: data = resp.json() # Calibre-Web uses DataTables format: "data"/"recordsTotal", older versions use "rows"/"total_count" rows = data.get("rows") or data.get("data") or [] - total = data.get("total_count") or data.get("recordsTotal") or data.get("recordsFiltered") or 0 + total = data.get("total") or data.get("totalNotFiltered") or 0 all_books.extend(rows) - log.info("Books fetched: %d so far (page start=%d, page_size=%d, total=%d)", len(all_books), start, len(rows), total) + log.info("Books fetched: %d / %d", len(all_books), total) if not rows or len(all_books) >= total: break start += len(rows)