From aecd4d2a4fe7b49a9c43229e07fde2a2b16823db Mon Sep 17 00:00:00 2001 From: Christof Dorner Date: Thu, 2 Feb 2023 12:36:34 +0100 Subject: [PATCH 1/3] Upgrade development black to 22.12.0 --- dev-tools/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-tools/requirements.txt b/dev-tools/requirements.txt index a84bf64b2..a69d319ab 100644 --- a/dev-tools/requirements.txt +++ b/dev-tools/requirements.txt @@ -1 +1 @@ -black==22.3.0 +black==22.12.0 From 60a0075bf4b9741289103672dce93bb5889e495b Mon Sep 17 00:00:00 2001 From: Christof Dorner Date: Thu, 2 Feb 2023 12:36:46 +0100 Subject: [PATCH 2/3] Pin Github Actions black to 22.12.0 --- .github/workflows/black.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 95a0ebfb0..4e7be4af3 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -13,3 +13,5 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 - uses: psf/black@22.12.0 + with: + version: 22.12.0 From 22eeee7368e0a7d54451b1a86e28e38b2887db8c Mon Sep 17 00:00:00 2001 From: 0x29a Date: Thu, 2 Feb 2023 21:02:57 +0100 Subject: [PATCH 3/3] Urlencode search query --- bookwyrm/connectors/abstract_connector.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bookwyrm/connectors/abstract_connector.py b/bookwyrm/connectors/abstract_connector.py index 6dd8a3081..0e04ffaf2 100644 --- a/bookwyrm/connectors/abstract_connector.py +++ b/bookwyrm/connectors/abstract_connector.py @@ -1,5 +1,6 @@ """ functionality outline for a book data connector """ from abc import ABC, abstractmethod +from urllib.parse import quote_plus import imghdr import logging import re @@ -48,7 +49,7 @@ class AbstractMinimalConnector(ABC): return f"{self.isbn_search_url}{normalized_query}" # NOTE: previously, we tried searching isbn and if that produces no results, # searched as free text. This, instead, only searches isbn if it's isbn-y - return f"{self.search_url}{query}" + return f"{self.search_url}{quote_plus(query)}" def process_search_response(self, query, data, min_confidence): """Format the search results based on the formt of the query"""