From 46be7292fde320df25ab65b5aa5a929bacce3a4f Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 14 Jun 2021 12:30:43 -0700 Subject: [PATCH] Don't try title/author search when isbn search fails --- bookwyrm/models/import_job.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bookwyrm/models/import_job.py b/bookwyrm/models/import_job.py index c8130af26..f29938469 100644 --- a/bookwyrm/models/import_job.py +++ b/bookwyrm/models/import_job.py @@ -75,7 +75,12 @@ class ImportItem(models.Model): def resolve(self): """try various ways to lookup a book""" - self.book = self.get_book_from_isbn() or self.get_book_from_title_author() + if self.isbn: + self.book = self.get_book_from_isbn() + else: + # don't fall back on title/author search is isbn is present. + # you're too likely to mismatch + self.get_book_from_title_author() def get_book_from_isbn(self): """search by isbn"""