mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 10:01:04 +00:00
Load descriptions correctly
This commit is contained in:
parent
b1c38d291c
commit
7853610a20
2 changed files with 3 additions and 4 deletions
|
@ -70,7 +70,7 @@ class Connector(AbstractConnector):
|
|||
# flatten the data so that images, uri, and claims are on the same level
|
||||
return {
|
||||
**data.get("claims", {}),
|
||||
**{k: data.get(k) for k in ["uri", "image", "labels"]},
|
||||
**{k: data.get(k) for k in ["uri", "image", "labels", "sitelinks"]},
|
||||
}
|
||||
|
||||
def parse_search_data(self, data):
|
||||
|
@ -193,7 +193,7 @@ class Connector(AbstractConnector):
|
|||
return results
|
||||
|
||||
def get_description(self, links):
|
||||
"""grab an extracted except from wikipedia"""
|
||||
"""grab an extracted excerpt from wikipedia"""
|
||||
link = links.get("enwiki")
|
||||
if not link:
|
||||
return ""
|
||||
|
|
|
@ -215,9 +215,8 @@ class Edition(Book):
|
|||
rank += int(bool(self.cover)) * 3
|
||||
# is it in the instance's preferred language?
|
||||
rank += int(bool(DEFAULT_LANGUAGE in self.languages))
|
||||
print(DEFAULT_LANGUAGE)
|
||||
# prefer print editions
|
||||
rank += int(bool(self.physical_format.lower() in ['paperback', 'hardcover']))
|
||||
rank += int(bool(self.physical_format.lower() in ["paperback", "hardcover"]))
|
||||
|
||||
# does it have metadata?
|
||||
rank += int(bool(self.isbn_13))
|
||||
|
|
Loading…
Reference in a new issue