[books] Fix two bugs in looking up books

This commit is contained in:
2025-02-25 21:07:45 -05:00
parent baa8dbee46
commit 1f67207f81
2 changed files with 5 additions and 2 deletions

View File

@ -172,7 +172,10 @@ class Book(LongPlayScrobblableMixin):
author_list = [] author_list = []
authors = book_dict.pop("authors") authors = book_dict.pop("authors")
cover_url = book_dict.pop("cover_url") cover_url = book_dict.pop("cover_url")
genres = book_dict.pop("generes") try:
genres = book_dict.pop("generes")
except:
genres = []
if authors: if authors:
for author_str in authors: for author_str in authors:

View File

@ -44,7 +44,7 @@ def lookup_book_from_google(title: str) -> dict:
# book_metadata["title"] = ": ".join( # book_metadata["title"] = ": ".join(
# [google_result.get("title"), google_result.get("subtitle")] # [google_result.get("title"), google_result.get("subtitle")]
# ) # )
book_dict["subtitle"] = google_result.get("subtitle") # book_dict["subtitle"] = google_result.get("subtitle")
book_dict["authors"] = google_result.get("authors") book_dict["authors"] = google_result.get("authors")
book_dict["publisher"] = google_result.get("publisher") book_dict["publisher"] = google_result.get("publisher")
book_dict["first_publish_year"] = publish_date.year book_dict["first_publish_year"] = publish_date.year