fix(media): 载入旧转写缓存时清洗非语音标记——#198 的读取侧防线#207
Merged
Merged
Conversation
…pt caches (#198) The #198 whisper-layer filter only runs on NEW transcriptions; the on-disk transcript cache short-circuits re-transcription, so a cache written before the filter existed kept resurrecting '[BLANK_AUDIO]' captions forever (reproduced on-device after the filter shipped). Add sanitize_transcription and apply it at both disk-read points (cached_on_disk + TranscriptCache's memory-then-disk path); rebuilds text from surviving segments when anything was stripped, passes clean results through untouched.
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.
真机复现(修复版 1.0.0 回归测试中发现)
#198 的 whisper 层过滤(PR #204)只作用于新转写;磁盘转写缓存(
media-cache/Transcripts/<key>.json)命中时短路重转写,修复前写入的旧缓存永远复活 '[BLANK_AUDIO]' 字幕。真机验证:同一素材 add_captions,删缓存后干净、缓存存在时垃圾字幕重现。修复
sanitize_transcription(transcribe/mod.rs):滤除 marker 行(segments+words),有剥除时用幸存 segments 重建 text,干净结果原样直通(幂等)cached_on_disk+TranscriptCache::cached(memory-then-disk 路径)测试
cached_on_disk_scrubs_pre_filter_marker_rows:构造含 [BLANK_AUDIO] 的旧格式缓存文件,两条读取路径载入均断言已清洗sanitize_strips_marker_rows_and_rebuilds_text/sanitize_passes_clean_results_through_untouchedcargo test -p opentake-media 全绿,clippy -D warnings 零告警。
Fixes #198(读取侧补全)