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