From 2034bd5f2ba1aeb195a6dbc34796c5927de2003d Mon Sep 17 00:00:00 2001 From: grymphen Date: Sun, 10 May 2026 22:54:17 +0200 Subject: [PATCH] check for doubles --- uploader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)