From ef1896da18b78f53b388cb9cd5df12c57b204bb0 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 10 Aug 2021 14:02:22 -0700 Subject: [PATCH] Return confidence rating --- bookwyrm/models/import_job.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bookwyrm/models/import_job.py b/bookwyrm/models/import_job.py index 53368bce2..53192ce37 100644 --- a/bookwyrm/models/import_job.py +++ b/bookwyrm/models/import_job.py @@ -85,7 +85,7 @@ class ImportItem(models.Model): if self.isbn: self.book = self.get_book_from_isbn() 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 book, confidence = self.get_book_from_title_author() if confidence > 0.999: @@ -111,7 +111,10 @@ class ImportItem(models.Model): ) if search_result: # 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 @property