From dea19097b9b724d64bb375a2cbf5c44e3ef35ed6 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Sun, 4 Oct 2026 16:55:13 +0800 Subject: [PATCH] fix(api): add pre_trusted_images to ViralVideoJobResponse schema and _to_response The trust chain preheat images are persisted in DB but were not exposed in API responses, making debugging impossible. Add pre_trusted_images field (list[str] | None = None) to ViralVideoJobResponse and populate it in _to_response(). Ref: #2175 t2i trust chain --- apps/api/app/api/routes/viral_video.py | 1 + apps/api/app/schemas/viral_video.py | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/api/app/api/routes/viral_video.py b/apps/api/app/api/routes/viral_video.py index 3ddcb8e90..a2643e62d 100644 --- a/apps/api/app/api/routes/viral_video.py +++ b/apps/api/app/api/routes/viral_video.py @@ -146,6 +146,7 @@ def _to_response(job) -> ViralVideoJobResponse: video_model=getattr(job, "video_model", "") or "", intent_result=job.intent_result, result_video_url=job.result_video_url, + pre_trusted_images=getattr(job, "pre_trusted_images", None) or None, video_resolution=getattr(job, "video_resolution", "720p") or "720p", credits_prepaid=float(getattr(job, "credits_prepaid", 0) or 0), credits_cost=float(getattr(job, "credits_cost", 0) or 0), diff --git a/apps/api/app/schemas/viral_video.py b/apps/api/app/schemas/viral_video.py index cdc8d758a..cb55d2dbb 100755 --- a/apps/api/app/schemas/viral_video.py +++ b/apps/api/app/schemas/viral_video.py @@ -222,6 +222,7 @@ class ViralVideoJobResponse(BaseModel): video_model: str = "" intent_result: dict | None = None result_video_url: str = "" + pre_trusted_images: list[str] | None = None video_resolution: str = "720p" credits_prepaid: float = 0.0 credits_cost: float = 0.0 -- 2.54.0