fix(test1): 短文案重试时补后缀,避免覆盖自定义模板

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
eric 2026-08-15 08:14:21 -05:00
parent e0d4a95c0c
commit f226fb87ce

View File

@ -491,7 +491,10 @@ class XClipsPipeline:
caption = str(job.get("caption") or "").strip() or build_caption(job, cfg)
bare = "".join(ch for ch in caption if not ch.isspace())
if len(bare) < 8:
caption = build_caption(job, cfg)
suffix = "直播精彩瞬间"
caption = f"{caption} {suffix}".strip() if suffix not in caption else caption
if len("".join(ch for ch in caption if not ch.isspace())) < 8:
caption = build_caption(job, cfg)
media_url = str(job.get("media_url") or "").strip()
media_key = str(job.get("media_key") or "").strip()
clip = str(job.get("clip_path") or "").strip()