[mod] migration of some engine results to the video class (#6743)

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser
2026-09-20 16:20:15 +02:00
committed by Markus Heiser
parent ce48993997
commit 2e41cf7407
22 changed files with 93 additions and 132 deletions

View File

@@ -178,17 +178,14 @@ def response(resp: "SXNG_Response") -> EngineResults:
length = parse_duration_string(result["props"]["duration"])
res.add(
res.types.LegacyResult(
{
"template": "videos.html",
"url": result["url"],
"title": html_to_text(result.get("title", "no title available")),
"content": html_to_text(result.get("snippet", "")),
"thumbnail": result.get("image", {}).get("url"),
"publishedDate": published_date,
"author": result.get("props", {}).get("creator_name"),
"length": length,
}
res.types.Video(
url=result["url"],
title=html_to_text(result.get("title", "no title available")),
content=html_to_text(result.get("snippet", "")),
thumbnail=result.get("image", {}).get("url"),
publishedDate=published_date,
author=result.get("props", {}).get("creator_name"),
length=length,
)
)