Skip to content

Commit

Permalink
Bugfix search with wrong custom column configured
Browse files Browse the repository at this point in the history
  • Loading branch information
OzzieIsaacs committed Jul 23, 2022
1 parent a72f16f commit a3f7dc2
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 632 deletions.
2 changes: 2 additions & 0 deletions cps/metadata_provider/scholar.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def search(
tokens = [quote(t.encode("utf-8")) for t in title_tokens]
query = " ".join(tokens)
try:
scholarly.set_timeout(20)
scholarly.set_retries(2)
scholar_gen = itertools.islice(scholarly.search_pubs(query), 10)
except Exception as e:
log.warning(e)
Expand Down
3 changes: 3 additions & 0 deletions cps/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ def adv_search_read_status(read_status):
db_filter = coalesce(db.cc_classes[config.config_read_column].value, False) != True
except (KeyError, AttributeError, IndexError):
log.error("Custom Column No.{} does not exist in calibre database".format(config.config_read_column))
flash(_("Custom Column No.%(column)d does not exist in calibre database",
column=config.config_read_column),
category="error")
return true()
return db_filter

Expand Down
6 changes: 3 additions & 3 deletions optional-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ SQLAlchemy-Utils>=0.33.5,<0.39.0

# metadata extraction
rarfile>=3.2
scholarly>=1.2.0,<1.7
scholarly>=1.2.0,<1.8
markdown2>=2.0.0,<2.5.0
html2text>=2020.1.16,<2022.1.1
python-dateutil>=2.1,<2.9.0
beautifulsoup4>=4.0.1,<4.11.0
beautifulsoup4>=4.0.1,<4.12.0
cchardet>=2.0.0,<2.2.0

# Comics
natsort>=2.2.0,<8.2.0
comicapi>=2.2.0,<2.3.0

# Kobo integration
jsonschema>=3.2.0,<4.7.0
jsonschema>=3.2.0,<4.8.0
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ comics =
natsort>=2.2.0,<8.2.0
comicapi>=2.2.0,<2.3.0
kobo =
jsonschema>=3.2.0,<4.6.0
jsonschema>=3.2.0,<4.7.0

Loading

0 comments on commit a3f7dc2

Please sign in to comment.