فهرست منبع

[books] Fix two bugs in looking up books

Colin Powell 2 ماه پیش
والد
کامیت
1f67207f81
2فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 4 1
      vrobbler/apps/books/models.py
  2. 1 1
      vrobbler/apps/books/sources/google.py

+ 4 - 1
vrobbler/apps/books/models.py

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

+ 1 - 1
vrobbler/apps/books/sources/google.py

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