Embed summary in transcript DOCX for 'Transcribe & summarize'; remove separate summary files
Mirror and run GitLab CI / build (push) Has been cancelled
Ruff / ruff (push) Has been cancelled

This commit is contained in:
admin
2026-06-20 03:58:37 +00:00
parent 5b5904c354
commit 800a009c85
2 changed files with 46 additions and 32 deletions
+14 -28
View File
@@ -417,12 +417,19 @@ def process_transcription_task(
f.write(transcript_text)
temp_files.append(md_transcript_path)
# Transcript .docx (standalone, no cover page)
# Transcript .docx (with summary appended if transcript_and_summarize)
docx_transcript_path = _safe_filename("TRANSCRIPT", local, date_tag, ".docx")
create_transcript_docx(
transcript_text,
docx_transcript_path,
)
if summary_text:
create_transcript_docx(
transcript_text,
docx_transcript_path,
summary_text=summary_text,
)
else:
create_transcript_docx(
transcript_text,
docx_transcript_path,
)
temp_files.append(docx_transcript_path)
# JSON as SOURCE
@@ -445,25 +452,8 @@ def process_transcription_task(
json.dump(json_data, f, indent=2, ensure_ascii=False)
temp_files.append(json_path)
# Summary files (if present)
md_summary_path = None
docx_summary_path = None
if summary_text:
# Summary .md
md_summary_path = _safe_filename("SUMMARY", local, date_tag, ".md")
with open(md_summary_path, "w", encoding="utf-8") as f:
f.write("# Summary\n\n")
f.write(summary_text)
temp_files.append(md_summary_path)
# Summary .docx (standalone, no cover page)
docx_summary_path = _safe_filename("SUMMARY", local, date_tag, ".docx")
create_summary_docx(
summary_text,
docx_summary_path,
)
temp_files.append(docx_summary_path)
# No separate summary DOCX/MD when using transcript_and_summarize
# (summary is now embedded in the transcript DOCX)
# 5) Build attachments list
@@ -474,10 +464,6 @@ def process_transcription_task(
json_path,
]
# If summary is present, add summary MD and DOCX
if summary_text:
attachments += [md_summary_path, docx_summary_path]
# 6) Send success email
send_success_email(
to=email_to,