feat: 完善本地 TTML 歌词匹配机制(支持专辑消歧与三档匹配强度) - #238
Open
kid141252010 wants to merge 3 commits into
Open
kid141252010 wants to merge 3 commits into
kid141252010 wants to merge 3 commits into
Conversation
kid141252010
force-pushed
the
feat/local-ttml-match-level
branch
from
September 5, 2026 06:02
2d07e72 to
8f438a3
Compare
This branch has not been deployed
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.
改动类型
是否包含破坏性变更
改动说明
背景与动机
此前本地 TTML 歌词库(
localLyricRepo)在按标题匹配时,仅根据歌名进行匹配,同名文件只有 1 首时直接命中,多首且艺术家不符时依然兜底返回第 1 首。这不仅会导致不同歌手的“同名异曲”被错误覆盖,也会导致同一歌手同一歌曲的“不同专辑版本”(如录音室版 vs. 演唱会 Live 版)因缺乏专辑元数据匹配而选错版本、时间戳错乱。主要改动
localLyricRepo中解析<amll:meta key="album" ...>标签(并兼容albumName),支持多专辑标签拼接合并。LocalLyricMatchLevel):strict):必须通过平台数字 ID 精确命中,或歌名与艺术家完全一致;双方均有专辑时专辑也必须匹配(严格杜绝录音室与现场版错配);不接受模糊包含,元数据缺失时不匹配。standard,默认推荐):歌名必须一致,艺术家必须匹配(支持合唱、feat.包含);多版本时根据专辑匹配度自动择优消歧(专辑一致优先);双方均有明确艺术家但互不相干时坚决拒绝兜底,避免同名异曲误匹配。loose):保持原有宽松容错行为,多候选时按艺术家与专辑评分挑选最佳候选,无匹配兜底首个。utils.ts中的artistMatches、normalizeTrackArtists和bothContains;zh-CN与en-US翻译。关联 Issue
测试情况
pnpm typecheck(Node 与 Web 端类型编译)均通过。pnpm test:web,10 个测试文件(57 个用例)全部通过。feat.场景:标准模式支持包含匹配正常命中。自查清单
pnpm format,并确认pnpm typecheck、pnpm lint通过pnpm build:native验证;未手写native/*/index.d.tsdev分支提交