diff --git a/bookwyrm/connectors/connector_manager.py b/bookwyrm/connectors/connector_manager.py index d3b01f7a..a63a788e 100644 --- a/bookwyrm/connectors/connector_manager.py +++ b/bookwyrm/connectors/connector_manager.py @@ -35,10 +35,10 @@ def search(query, min_confidence=0.1): return results -def local_search(query, min_confidence=0.1): +def local_search(query, min_confidence=0.1, raw=False): ''' only look at local search results ''' connector = load_connector(models.Connector.objects.get(local=True)) - return connector.search(query, min_confidence=min_confidence) + return connector.search(query, min_confidence=min_confidence, raw=raw) def first_search_result(query, min_confidence=0.1): diff --git a/bookwyrm/connectors/self_connector.py b/bookwyrm/connectors/self_connector.py index c5d58a59..f57fbc1c 100644 --- a/bookwyrm/connectors/self_connector.py +++ b/bookwyrm/connectors/self_connector.py @@ -11,7 +11,8 @@ from .abstract_connector import AbstractConnector, SearchResult class Connector(AbstractConnector): ''' instantiate a connector ''' - def search(self, query, min_confidence=0.1): + # pylint: disable=arguments-differ + def search(self, query, min_confidence=0.1, raw=False): ''' search your local database ''' if not query: return [] @@ -22,10 +23,14 @@ class Connector(AbstractConnector): results = search_title_author(query, min_confidence) search_results = [] for result in results: - search_results.append(self.format_search_result(result)) + if raw: + search_results.append(result) + else: + search_results.append(self.format_search_result(result)) if len(search_results) >= 10: break - search_results.sort(key=lambda r: r.confidence, reverse=True) + if not raw: + search_results.sort(key=lambda r: r.confidence, reverse=True) return search_results diff --git a/bookwyrm/templates/layout.html b/bookwyrm/templates/layout.html index 1a6c065e..fe8a7509 100644 --- a/bookwyrm/templates/layout.html +++ b/bookwyrm/templates/layout.html @@ -59,10 +59,10 @@ Feed - {% endif %} Lists + {% endif %}