mirror of
https://github.com/searxng/searxng.git
synced 2026-05-26 21:00:13 +02:00
[mod] engine flaticon: migrate from LegacyResult to Image (#6142)
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
committed by
Markus Heiser
parent
a16a3dedb4
commit
3db8b424a8
@@ -54,16 +54,13 @@ def response(resp: "SXNG_Response"):
|
||||
result: dict[str, str] # TBH: dict[str, t.Any]
|
||||
for result in resp.json()["items"]:
|
||||
res.add(
|
||||
res.types.LegacyResult(
|
||||
{
|
||||
"template": "images.html",
|
||||
"url": _fix_url(result["slug"]),
|
||||
"thumbnail_src": _fix_url(result["png"]),
|
||||
"img_src": _fix_url(result["png512"]),
|
||||
"title": result["name"],
|
||||
"content": ", ".join([tag["tag"] for tag in result["tags"]]), # pyright: ignore[reportArgumentType]
|
||||
"author": result["team_name"],
|
||||
}
|
||||
res.types.Image(
|
||||
title=result["name"],
|
||||
content=", ".join([tag["tag"] for tag in result["tags"]]), # pyright: ignore[reportArgumentType]
|
||||
url=_fix_url(result["slug"]),
|
||||
thumbnail_src=_fix_url(result["png"]),
|
||||
img_src=_fix_url(result["png512"]),
|
||||
author=result["team_name"],
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user