Browse Source

Merge pull request #8054 from hannsen/master

search only when category is supported by plugin
adaptive-webui-19844
sledgehammer999 7 years ago committed by GitHub
parent
commit
8a590c7472
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/searchengine/nova/nova2.py
  2. 4
      src/searchengine/nova3/nova2.py

4
src/searchengine/nova/nova2.py

@ -128,8 +128,8 @@ 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)
return True return True

4
src/searchengine/nova3/nova2.py

@ -127,8 +127,8 @@ 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