From 80fcb6c00287298eb375a93f6b2b2a2b1c39b0ee Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Mon, 20 Oct 2025 14:54:53 -0400 Subject: [PATCH] [books] Clean up google searches --- vrobbler/apps/books/sources/google.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vrobbler/apps/books/sources/google.py b/vrobbler/apps/books/sources/google.py index 1cdf195..ae25ca1 100644 --- a/vrobbler/apps/books/sources/google.py +++ b/vrobbler/apps/books/sources/google.py @@ -59,13 +59,15 @@ def lookup_book_from_google(title: str) -> dict: book_dict["genres"] = google_result.get("categories") book_dict["cover_url"] = ( google_result.get("imageLinks", {}) - .get("thumbnail") + .get("thumbnail", "") .replace("zoom=1", "zoom=15") .replace("&edge=curl", "") ) - book_dict["run_time_seconds"] = book_dict.get("pages", 10) * getattr( - settings, "AVERAGE_PAGE_READING_SECONDS", 60 - ) + book_dict["run_time_seconds"] = 3600 + if book_dict.get("pages"): + book_dict["run_time_seconds"] = book_dict.get("pages", 10) * getattr( + settings, "AVERAGE_PAGE_READING_SECONDS", 60 + ) return book_dict