Repository navigation
fix: 合并解析优化并发布整秒歌词兼容修复 - #11
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
TTML range expansion incorrectly ignores explicitly timed child ranges beginning at zero milliseconds.
1 open finding
What changed in this PR
Fixes whole-second LRC parsing from SPlayer-Next #338 while merging parser, serialization, alignment, and lookup improvements for the 0.6.1 release.
Changes:
- Adds whole-second and expanded timestamp compatibility across lyric formats.
- Improves offset/kana handling, auxiliary lyric matching, and TTML timing.
- Adds round-trip serialization and indexed active-line lookup.
| File | Description |
|---|---|
tests/timestamp-compatibility.spec.ts |
Covers timestamp compatibility. |
tests/sync-index.spec.ts |
Validates indexed lookup. |
tests/serialize-roundtrip.spec.ts |
Tests round-trip exports. |
tests/serialize-options.spec.ts |
Tests serialization options. |
tests/pair-translation.spec.ts |
Covers auxiliary alignment. |
tests/offset-options.spec.ts |
Verifies offset independence. |
tests/external-kana-offset.spec.ts |
Tests external kana offsets. |
tests/combined-parser-regressions.spec.ts |
Adds cross-feature regressions. |
src/utils/timestamp.ts |
Expands timestamp parsing. |
src/utils/sync.ts |
Adds indexed active-line queries. |
src/utils/kana.ts |
Applies kana timing offsets. |
src/types.ts |
Adds serialization options. |
src/serialize/srt.ts |
Adds SRT round-trip mode. |
src/serialize/lrc.ts |
Adds LRC round-trip precision. |
src/serialize/index.ts |
Supports nested parse options. |
src/parse/yrc.ts |
Decouples offsets from metadata output. |
src/parse/ttml.ts |
Expands TTML timing ranges. |
src/parse/srt.ts |
Handles whole-second and invalid cues. |
src/parse/qrc.ts |
Decouples offsets from metadata output. |
src/parse/lys.ts |
Decouples offsets from metadata output. |
src/parse/lrc.ts |
Parses whole-second LRC tags. |
src/parse/krc.ts |
Supports whole-second KRC headers. |
src/parse/index.ts |
Improves detection and auxiliary matching. |
src/index.ts |
Exports new public APIs. |
README.md |
Documents new behavior. |
README.zh-CN.md |
Updates Chinese documentation. |
package.json |
Bumps version to 0.6.1. |
benchmarks/sync.mjs |
Benchmarks indexed lookup. |
benchmarks/README.md |
Documents benchmark results. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (bgState.words.length > 0) { | ||
| const childStart = Math.min(...bgState.words.map((word) => word.startTime)); | ||
| const childEnd = Math.max(...bgState.words.map((word) => word.endTime)); | ||
| if (bgStart === 0 || (childStart > 0 && childStart < bgStart)) bgStart = childStart; |
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.

整秒 LRC 标签(如
[00:01])在 0.6.0 中被丢弃,导致 SPlayer-Next 将有效歌词显示为无歌词。本次统一正文、外部翻译/罗马音和逐字标签的整秒解析,并准备发布 0.6.1。一并合入
feat/compatible-parser-improvements,保留原导出默认行为和扁平解析参数兼容性。优化包括精确时间优先的辅助歌词匹配、独立生效的 offset、显式 roundTrip 导出与可复用时间索引;新增回归修复同时开始的歌手归属、内嵌/外部注音重复和往返模式的毫秒精度。TTML 以 applemusic-like-lyrics 本地源码为参照:歌手顺序变化时按 agent ID 对齐,行时间按逐字及背景人声范围计算。另完善 SRT 整秒及非法时间处理、ASS 不完整头部识别、KRC 分秒行头与 TTML 时间单位兼容。
验证:
关联:SPlayer-Dev/SPlayer-Next#338