Accept alias subtitle suffixes when detecting existing outputs - #29
Merged
Conversation
…outputs instead of re-translating.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
字幕文件在外界常用 .cn/.chs/.zh-cn 等后缀命名中文;此前检测只认规范后缀(.zh/.en),目录里手动放置或其他工具生成的 lecture.cn.srt 不被识别为已有翻译,批量运行时会对着现成的字幕再翻一遍。
改动与实现
验证
uv run pytest -q:166 passed / 5 skipped;新增两例——存在 lecture.cn.srt 时 translate 返回该文件且模型零调用;existing_transcript 对 zh 强制与 auto 两种模式均命中 .cn.srt,对 ja 不误报