tingwu_new
All checks were successful
Deploy to Server / deploy (push) Successful in 1m8s

This commit is contained in:
jeremygan2021
2026-03-11 20:46:25 +08:00
parent f41fd01367
commit 7612c09571
9 changed files with 319 additions and 11 deletions

View File

@@ -291,7 +291,30 @@ class AliyunTingwuService:
# 保存原始数据
task.auto_chapters_data = auto_chapters
# (可选) 将章节信息追加到 summary 或 evaluation 中,或者仅保存 raw data
# 根据用户需求,这里主要保存到 model 的 auto_chapters_data 字段 (已在 models.py 定义)
# 将章节信息追加到 summary
if auto_chapters and isinstance(auto_chapters, list):
if summary_text:
summary_text.append("\n\n### 章节速览")
else:
summary_text.append("### 章节速览")
for chapter in auto_chapters:
headline = chapter.get('Headline', '')
summary = chapter.get('Summary', '')
start_time = chapter.get('Start', 0)
# 格式化时间戳 (毫秒 -> HH:MM:SS)
seconds = int(start_time / 1000)
m, s = divmod(seconds, 60)
h, m = divmod(m, 60)
time_str = f"{h:02d}:{m:02d}:{s:02d}"
chapter_text = f"- [{time_str}] {headline}"
if summary:
chapter_text += f"\n {summary}"
summary_text.append(chapter_text)
if summary_text:
task.summary = "\n".join(summary_text)
task.save()