|
|
@@ -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
|