Repository navigation
Conversation
7 of 12 tasks
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 歌词库」扩展为通用「本地歌词库」:
localLyric.repoDir(单个目录)改为localLyric.repoDirs(目录列表),设置页可添加 / 移除多个目录,每个目录都会递归扫描,靠前的目录优先。.ttml外支持.lrc、.lys、.ass、.srt;同一首歌命中多个文件时按全局歌词格式优先级取值。歌曲ID.后缀名或任意前缀.歌曲ID.后缀名即可命中,与旧版 SPlayer 的命名规则一致。<amll:meta>(musicName / artists / ncmMusicId / qqMusicId),LRC / LyS 额外读[ti:]/[ar:]参与标题匹配;原有「标题 + 艺术家软性区分」与「匹配缓存 id 回查」流程不变。enableLocalLyricOverride)。repoDir并入repoDirs、enableLocalTTMLOverride值搬到新键,升级后已有设置不丢。lyrics:matchLocalTTML→lyrics:matchLocalLyric(仍返回文件原文,渲染层用detectFormat判断实际格式,不再硬编码ttml);设置页组件改为多目录管理;中英文案与文档同步更新。version 1(electron/main/store/migrations.ts)。关联 Issue
Closes #357
测试情况
自动化:
electron/main/services/localLyricRepo.spec.ts(vitest,12 例):按文件名 ID 命中(含子目录)、同 ID 多格式取格式优先级最高者、LRC[ti:]/[ar:]标题匹配、TTML AMLL 元信息匹配(含多个ncmMusicId全部入索引)、多目录靠前者优先、QQ songmid 不参与文件名匹配而数字 songId 参与、开关关闭时不读盘、根目录与子目录新增文件后重建索引、构建途中更换目录集合、匹配缓存 id 回查。electron/main/store/migrations.spec.ts(vitest,2 例):单目录与旧开关迁移到新键、未设置目录时不产生脏数据。pnpm format、pnpm typecheck、pnpm lint、pnpm test(63 个文件 / 489 例)全部通过。手动(Windows 11,
pnpm build产出的打包版,独立 user-data 目录,未触碰既有安装版配置):localLyric.repoDir单目录 +enableLocalTTMLOverride)首启,落盘后的settings.json变为repoDirs: [...]与enableLocalLyricOverride: true,旧键已清除,__configVersion为 1。window.api.lyrics.matchLocalLyric(...):id: 314572→ 命中目录 A 的314572.ttml(AMLL 元信息);title: 测试歌曲→ 命中同名条目并按格式优先级取.ttml;id: 88(同 ID 同时有.lrc与.srt)→ 取.lrc;id: 999(只存在于目录 B)→ 命中目录 B 的文件;data: null。97773.lrc的内容(对照见下方截图)。截图 / 录屏
设置页「歌词设置 → 启用本地歌词库 / 歌词库目录」与多目录管理弹窗(Windows 11 打包版实测):
同一首歌的本地歌词生效对照(播放页,格式标记随来源变化):
自查清单
pnpm format,并确认pnpm typecheck、pnpm lint通过pnpm build:native验证;未手写native/*/index.d.tsdev分支提交