mirror of
https://github.com/searxng/searxng.git
synced 2026-10-19 09:54:24 +00:00
[feat] sort infobox so images are first (#6815)
Some checks failed
Documentation / Release (push) Has been cancelled
Integration / Python 3.11 (push) Has been cancelled
Integration / Python 3.12 (push) Has been cancelled
Integration / Python 3.13 (push) Has been cancelled
Integration / Python 3.14 (push) Has been cancelled
Integration / Theme (push) Has been cancelled
Sync / Codeberg (push) Has been cancelled
Some checks failed
Documentation / Release (push) Has been cancelled
Integration / Python 3.11 (push) Has been cancelled
Integration / Python 3.12 (push) Has been cancelled
Integration / Python 3.13 (push) Has been cancelled
Integration / Python 3.14 (push) Has been cancelled
Integration / Theme (push) Has been cancelled
Sync / Codeberg (push) Has been cancelled
Often there will be two or more results in the infobox. We now sort this so infoboxes with an image show above those that do not. Signed-off-by: vojkovic <git@vojk.au>
This commit is contained in:
parent
44b98e6102
commit
d48c4b5554
1 changed files with 2 additions and 0 deletions
|
|
@ -182,6 +182,8 @@ class ResultContainer:
|
|||
|
||||
def close(self):
|
||||
self._closed = True
|
||||
# infobox with images first
|
||||
self.infoboxes.sort(key=lambda infobox: not infobox.img_src)
|
||||
|
||||
for result in self.main_results_map.values():
|
||||
result.score = calculate_score(result, result.priority)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue