소스 검색

[books] Fix no result for detail lookup

Colin Powell 2 달 전
부모
커밋
8c600d6b4b
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      vrobbler/apps/books/sources/semantic.py

+ 3 - 0
vrobbler/apps/books/sources/semantic.py

@@ -38,6 +38,9 @@ def lookup_paper_from_semantic(title: str) -> dict:
 
     result = json.loads(response.content)
 
+    if not result:
+        return paper_dict
+
     page_str = result.get("journal", {}).get("pages")
     if page_str:
         try: