fix: 优化歌词加载并发流程,避免网络超时阻塞歌词展示与抢占 - #239
Open
kid141252010 wants to merge 1 commit into
Open
Conversation
kid141252010
force-pushed
the
fix/amll-db-timeout
branch
from
September 5, 2026 08:17
1aed506 to
99ff400
Compare
kid141252010
force-pushed
the
fix/amll-db-timeout
branch
from
September 6, 2026 02:35
99ff400 to
e2615ef
Compare
kid141252010
force-pushed
the
fix/amll-db-timeout
branch
from
September 6, 2026 03:09
e2615ef to
d9c8b36
Compare
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.
改动类型
是否包含破坏性变更
改动说明
动机
applyOnline、resolveStreamingByPreference及resolveLyricForPreload等多处同步await resolveTTMLOverlay()。当 AMLL DB 服务端响应慢或超时(8s)时,会导致基础歌词、内嵌歌词或插件歌词迟迟无法展示,严重影响切歌体感。loadPlatformLyric缺少onCandidate即时提交回调,导致并发查询多个平台时,即使已有平台返回了歌词,仍会被其他慢响应或超时的平台(如酷狗网络波动)阻塞长达 8 秒。onCandidate回调无条件写入,可能导致已显示的优质歌词(如 TTML/QRC)被延迟返回的低优先级普通 LRC 降级覆盖。主要变更
resolveTTMLOverlay改为后台静默触发(tryApplyTTMLOverlay),先即时呈现本地/内嵌/平台在线基础歌词,TTML 命中后再热替换升级;await阻塞。commitIfBetter):loadPlatformLyric)、本地歌曲和刷新偏好流程统一接入commitIfBetter作为onCandidate提交回调,任一平台就绪立即抢先展示,无需等待其他平台超时;isBetterFormat)才允许覆盖,避免插件歌词或高优先级候选被后到的低优先级结果冲掉。hasParseableContent):AGENTS.md规范。测试情况
pnpm typecheck(Node + Web 目标)全绿通过。npx eslint检查通过,0 errors, 0 warnings。npx prettier --check格式检查全量通过。自查清单
pnpm format,并确认pnpm typecheck、pnpm lint通过pnpm build:native验证;未手写native/*/index.d.tsdev分支提交