[books] Fix two bugs in looking up books
This commit is contained in:
@ -172,7 +172,10 @@ class Book(LongPlayScrobblableMixin):
|
||||
author_list = []
|
||||
authors = book_dict.pop("authors")
|
||||
cover_url = book_dict.pop("cover_url")
|
||||
genres = book_dict.pop("generes")
|
||||
try:
|
||||
genres = book_dict.pop("generes")
|
||||
except:
|
||||
genres = []
|
||||
|
||||
if authors:
|
||||
for author_str in authors:
|
||||
|
||||
@ -44,7 +44,7 @@ def lookup_book_from_google(title: str) -> dict:
|
||||
# book_metadata["title"] = ": ".join(
|
||||
# [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["publisher"] = google_result.get("publisher")
|
||||
book_dict["first_publish_year"] = publish_date.year
|
||||
|
||||
Reference in New Issue
Block a user