mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-13 11:46:35 +00:00
Return confidence rating
This commit is contained in:
parent
fa396d4bc8
commit
ef1896da18
1 changed files with 5 additions and 2 deletions
|
@ -85,7 +85,7 @@ class ImportItem(models.Model):
|
||||||
if self.isbn:
|
if self.isbn:
|
||||||
self.book = self.get_book_from_isbn()
|
self.book = self.get_book_from_isbn()
|
||||||
else:
|
else:
|
||||||
# don't fall back on title/author search is isbn is present.
|
# don't fall back on title/author search if isbn is present.
|
||||||
# you're too likely to mismatch
|
# you're too likely to mismatch
|
||||||
book, confidence = self.get_book_from_title_author()
|
book, confidence = self.get_book_from_title_author()
|
||||||
if confidence > 0.999:
|
if confidence > 0.999:
|
||||||
|
@ -111,7 +111,10 @@ class ImportItem(models.Model):
|
||||||
)
|
)
|
||||||
if search_result:
|
if search_result:
|
||||||
# raises ConnectorException
|
# raises ConnectorException
|
||||||
return search_result.connector.get_or_create_book(search_result.key)
|
return (
|
||||||
|
search_result.connector.get_or_create_book(search_result.key),
|
||||||
|
search_result.confidence,
|
||||||
|
)
|
||||||
return None, 0
|
return None, 0
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Reference in a new issue