diff options
author | Alexandre Flament <alex@al-f.net> | 2017-03-14 12:35:40 +0100 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2017-05-22 22:20:35 +0200 |
commit | 7ebe3a6f41203e9714d920383443bf03891eba7f (patch) | |
tree | 6941f1526d87326faf752e9f7707655d4da19ec0 | |
parent | 87f673336fcfd27ce417d95a6099d5110998a05b (diff) | |
download | searxng-7ebe3a6f41203e9714d920383443bf03891eba7f.tar.gz searxng-7ebe3a6f41203e9714d920383443bf03891eba7f.zip |
[mod] add category to each results, and change group criterias (template and existing image)
-rw-r--r-- | searx/results.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/searx/results.py b/searx/results.py index b6d408e29..6abffb57a 100644 --- a/searx/results.py +++ b/searx/results.py @@ -250,9 +250,12 @@ class ResultContainer(object): for i, res in enumerate(results): # FIXME : handle more than one category per engine - category = engines[res['engine']].categories[0] + ':' + ''\ - if 'template' not in res\ - else res['template'] + res['category'] = engines[res['engine']].categories[0] + + # 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\ else categoryPositions[category] |