Browse Source

search only when category is supported by plugin Closes #8053

adaptive-webui-19844
jan.karberg 7 years ago
parent
commit
d534973650
  1. 2
      src/searchengine/nova/nova2.py
  2. 2
      src/searchengine/nova3/nova2.py

2
src/searchengine/nova/nova2.py

@ -128,7 +128,7 @@ def run_search(engine_list):
engine = engine() engine = engine()
#avoid exceptions due to invalid category #avoid exceptions due to invalid category
if hasattr(engine, 'supported_categories'): if hasattr(engine, 'supported_categories'):
cat = cat if cat in engine.supported_categories else "all" if cat in engine.supported_categories:
engine.search(what, cat) engine.search(what, cat)
else: else:
engine.search(what) engine.search(what)

2
src/searchengine/nova3/nova2.py

@ -127,7 +127,7 @@ def run_search(engine_list):
engine = engine() engine = engine()
#avoid exceptions due to invalid category #avoid exceptions due to invalid category
if hasattr(engine, 'supported_categories'): if hasattr(engine, 'supported_categories'):
cat = cat if cat in engine.supported_categories else "all" if cat in engine.supported_categories:
engine.search(what, cat) engine.search(what, cat)
else: else:
engine.search(what) engine.search(what)

Loading…
Cancel
Save