mirror of
https://github.com/searxng/searxng.git
synced 2024-11-22 12:10:11 +01:00
[mod] add category to each results, and change group criterias (template and existing image)
This commit is contained in:
parent
87f673336f
commit
7ebe3a6f41
@ -250,9 +250,12 @@ class ResultContainer(object):
|
|||||||
|
|
||||||
for i, res in enumerate(results):
|
for i, res in enumerate(results):
|
||||||
# FIXME : handle more than one category per engine
|
# FIXME : handle more than one category per engine
|
||||||
category = engines[res['engine']].categories[0] + ':' + ''\
|
res['category'] = engines[res['engine']].categories[0]
|
||||||
if 'template' not in res\
|
|
||||||
else res['template']
|
# FIXME : handle more than one category per engine
|
||||||
|
category = engines[res['engine']].categories[0]\
|
||||||
|
+ ':' + res.get('template', '')\
|
||||||
|
+ ':' + ('img_src' if 'img_src' in res or 'thumbnail' in res else '')
|
||||||
|
|
||||||
current = None if category not in categoryPositions\
|
current = None if category not in categoryPositions\
|
||||||
else categoryPositions[category]
|
else categoryPositions[category]
|
||||||
|
Loading…
Reference in New Issue
Block a user