search only when category is supported by plugin Closes #8053

This commit is contained in:
jan.karberg
2017-12-16 14:08:04 +01:00
committed by sledgehammer999
parent 02ae1e3734
commit 6db6c850eb
2 changed files with 4 additions and 4 deletions

View File

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

View File

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