feat: GET /transcripts/{filename} — serve transcript content

This commit is contained in:
2026-04-01 14:12:30 +02:00
parent 0bb0975a09
commit aa3eef8fb1
3 changed files with 46 additions and 1 deletions
+11
View File
@@ -35,6 +35,17 @@ def save_transcript(
return path
def read_transcript(output_dir: str, filename: str) -> str | None:
"""Return file content if filename is a plain .md file inside output_dir."""
if os.path.basename(filename) != filename or not filename.endswith(".md"):
return None
path = os.path.join(output_dir, filename)
if not os.path.exists(path):
return None
with open(path, encoding="utf-8") as f:
return f.read()
def list_transcripts(output_dir: str, limit: int = 20) -> list[dict]:
if not os.path.exists(output_dir):
return []