Merge branch 'rrgeorge/csp' of github.com:rrgeorge/bookwyrm into rrgeorge/csp

This commit is contained in:
Robert George 2023-02-03 11:53:52 -08:00
commit 297738dbb1
3 changed files with 5 additions and 2 deletions

View file

@ -13,3 +13,5 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-python@v4 - uses: actions/setup-python@v4
- uses: psf/black@22.12.0 - uses: psf/black@22.12.0
with:
version: 22.12.0

View file

@ -1,5 +1,6 @@
""" functionality outline for a book data connector """ """ functionality outline for a book data connector """
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from urllib.parse import quote_plus
import imghdr import imghdr
import logging import logging
import re import re
@ -48,7 +49,7 @@ class AbstractMinimalConnector(ABC):
return f"{self.isbn_search_url}{normalized_query}" return f"{self.isbn_search_url}{normalized_query}"
# NOTE: previously, we tried searching isbn and if that produces no results, # 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 # 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): def process_search_response(self, query, data, min_confidence):
"""Format the search results based on the formt of the query""" """Format the search results based on the formt of the query"""

View file

@ -1 +1 @@
black==22.3.0 black==22.12.0