From 3b31012901d0d8428ee913964b5eb7b0f3c4e609 Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Wed, 13 May 2026 19:18:02 +0100 Subject: [PATCH] fix(vtt): strip cue settings from end timestamp in parse_ad_cues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tts_synthesis.parse_ad_cues() was passing "00:00:02.500 line:0%" to _parse_timestamp() — cue settings were not stripped from the end-time part of the timing line. Split on whitespace and take first token only. Co-Authored-By: Claude Sonnet 4.6 --- backend/app/tasks/tts_synthesis.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/app/tasks/tts_synthesis.py b/backend/app/tasks/tts_synthesis.py index 53a28b5..adafcd4 100644 --- a/backend/app/tasks/tts_synthesis.py +++ b/backend/app/tasks/tts_synthesis.py @@ -454,7 +454,8 @@ def parse_ad_cues(vtt_content: str) -> list[dict]: if " --> " in line: timing_parts = line.split(" --> ") start_time = _parse_timestamp(timing_parts[0].strip()) - end_time = _parse_timestamp(timing_parts[1].strip()) + # Strip cue settings (e.g. "line:0% align:start") from end timestamp + end_time = _parse_timestamp(timing_parts[1].strip().split()[0]) # Get text from next line(s) i += 1