fix(subtitles): interpret short timestamp fields as milliseconds - #2422
Vaishnavi220506 wants to merge 3 commits into
Conversation
|
[Medium risk] Changes how subtitle timestamps interpret short millisecond fields. The PR appears safe to merge; no actionable issue remains. SummaryThe PR interprets short SRT and WebVTT timestamp fields as millisecond counts, adds regression coverage for comma and dot separators, and records the fix in the changelog. Reviews (2) · Last reviewed commit: "Merge main into subtitle timestamp fix" |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: debpalash/VoiceStudio/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe SRT parser now converts short timestamp millisecond fields directly to milliseconds. Tests cover one- and two-digit fields with comma and dot separators. The changelog records the fix. ChangesSRT timestamp parsing
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Short timestamp fields now retain their intended timing, with regression coverage for both separators. No concrete merge-blocking behavior is evident. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The fix changes timing values for already accepted short timestamp fields without expanding accepted input or bypassing existing validation. No material security risk was found to be introduced or worsened by this change. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 8 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (8 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (1 skipped: 1 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Imported SRT or WebVTT cues with a one- or two-digit millisecond field could be shifted by hundreds of milliseconds. Parse the accepted field as a millisecond count.
Problem
00:00:01,5 --> 00:00:02,50currently imports as 1.500–2.500 s. The parser accepts 1–3 digits and its timestamp helper documents 1.005–2.050 s for these fields. The same error occurs with.separators.Cause
_ts_to_secondspads the field on the right before converting it to milliseconds, multiplying one-digit values by 100 and two-digit values by 10.Changes
Testing
eef0e230: new regression test failed for both separators (2 failed).93462fa3:python -m pytest tests/test_srt_parser.py -q -p no:cacheprovider -k 'not paste_endpoint'— 57 passed, 1 deselected.python -m pytest tests/test_changelog_style.py -q -p no:cacheprovider— 13 passed.python -m compileall -q backend/services/srt_parser.py tests/test_srt_parser.py— passed.torchaudioDLL fails to load (WinError 127). CI runs Python 3.11.The SRT parser now treats one- and two-digit timestamp fields as literal millisecond counts, with regression tests for comma and dot separators. This prevents short fields such as
,5and.50from being interpreted as larger durations. No specific merge risk is established by the supplied evidence.