From f2a6cfb4f3a9c0cc42cd1db46271ef5ca1fbcfea Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Fri, 30 Apr 2021 16:04:27 -0700 Subject: [PATCH] Remove deduplication of external search results --- bookwyrm/connectors/connector_manager.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/bookwyrm/connectors/connector_manager.py b/bookwyrm/connectors/connector_manager.py index 3a6bf13cb..86cebe80a 100644 --- a/bookwyrm/connectors/connector_manager.py +++ b/bookwyrm/connectors/connector_manager.py @@ -29,8 +29,6 @@ def search(query, min_confidence=0.1): isbn = re.sub(r"[\W_]", "", query) maybe_isbn = len(isbn) in [10, 13] # ISBN10 or ISBN13 - dedup_slug = lambda r: "%s/%s/%s" % (r.title, r.author, r.year) - result_index = set() for connector in get_connectors(): result_set = None if maybe_isbn: @@ -53,10 +51,6 @@ def search(query, min_confidence=0.1): logger.exception(e) continue - # if the search results look the same, ignore them - result_set = [r for r in result_set if dedup_slug(r) not in result_index] - # `|=` concats two sets. WE ARE GETTING FANCY HERE - result_index |= set(dedup_slug(r) for r in result_set) results.append( { "connector": connector,