From 1844dd6b205b75e50a16b55202c10eeb4147beb3 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 10 May 2021 13:01:11 -0700 Subject: [PATCH] Only include result blobs with results in search results --- bookwyrm/connectors/connector_manager.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bookwyrm/connectors/connector_manager.py b/bookwyrm/connectors/connector_manager.py index 86cebe80..1fb375c9 100644 --- a/bookwyrm/connectors/connector_manager.py +++ b/bookwyrm/connectors/connector_manager.py @@ -43,7 +43,7 @@ def search(query, min_confidence=0.1): continue # if no isbn search or results, we fallback to generic search - if result_set in (None, []): + if not result_set: try: result_set = connector.search(query, min_confidence=min_confidence) except Exception as e: # pylint: disable=broad-except @@ -51,12 +51,13 @@ def search(query, min_confidence=0.1): logger.exception(e) continue - results.append( - { - "connector": connector, - "results": result_set, - } - ) + if result_set or connector.local: + results.append( + { + "connector": connector, + "results": result_set, + } + ) return results