diff --git a/bookwyrm/connectors/self_connector.py b/bookwyrm/connectors/self_connector.py index 2c58d9d7e..80d3a67d9 100644 --- a/bookwyrm/connectors/self_connector.py +++ b/bookwyrm/connectors/self_connector.py @@ -13,16 +13,16 @@ class Connector(AbstractConnector): that gets implemented it will totally rule ''' vector = SearchVector('title', weight='A') +\ SearchVector('subtitle', weight='B') +\ - SearchVector('author_text', weight='A') +\ + SearchVector('author_text', weight='C') +\ SearchVector('isbn_13', weight='A') +\ SearchVector('isbn_10', weight='A') +\ - SearchVector('openlibrary_key', weight='B') +\ - SearchVector('goodreads_key', weight='B') +\ - SearchVector('asin', weight='B') +\ - SearchVector('oclc_number', weight='B') +\ - SearchVector('remote_id', weight='B') +\ - SearchVector('description', weight='C') +\ - SearchVector('series', weight='C') + SearchVector('openlibrary_key', weight='C') +\ + SearchVector('goodreads_key', weight='C') +\ + SearchVector('asin', weight='C') +\ + SearchVector('oclc_number', weight='C') +\ + SearchVector('remote_id', weight='C') +\ + SearchVector('description', weight='D') +\ + SearchVector('series', weight='D') results = models.Edition.objects.annotate( search=vector diff --git a/bookwyrm/models/import_job.py b/bookwyrm/models/import_job.py index 58bf4de61..b35f79921 100644 --- a/bookwyrm/models/import_job.py +++ b/bookwyrm/models/import_job.py @@ -73,14 +73,11 @@ class ImportItem(models.Model): def get_book_from_isbn(self): ''' search by isbn ''' search_result = books_manager.first_search_result( - self.isbn, min_confidence=0.995 + self.isbn, min_confidence=0.999 ) if search_result: - try: - # don't crash the import when the connector fails - return books_manager.get_or_create_book(search_result.key) - except ConnectorException: - pass + # raises ConnectorException + return books_manager.get_or_create_book(search_result.key) return None @@ -91,7 +88,7 @@ class ImportItem(models.Model): self.data['Author'] ) search_result = books_manager.first_search_result( - search_term, min_confidence=0.995 + search_term, min_confidence=0.999 ) if search_result: # raises ConnectorException