#65

feat(lyrics): query lrc.red, lrclib and netease in parallel

OpenJustMarkDevwants to merge intofrom

Summary

  • Query lrc.red, LRCLIB, and Netease concurrently with 6s per-provider timeout and priority-based resolution
  • Prefer word-timed lyrics from any provider, then highest-priority synced result, then plain lyrics
  • Add enhanced-LRC word-tag detection, Netease yrc conversion, credit/instrumental cleanup, and shared metadata ranking
  • Preserve word timing through romanization with per-word romanize and language-aware spacing
  • Update README, overlay UI, styles, and cache handling for word-by-word highlighting

Testing

  • Not run: cargo test for lyrics resolve/ranking/yrc/romanization unit tests
  • Not run: frontend lyrics and cache unit tests in src/lyrics.test.ts and src/lyrics-cache.test.ts
  • Not run: manual overlay check for word-by-word vs line-by-line highlighting

Activity

21
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]1mo ago

Review · 9bbb92d

⚠️ 3 open findings

Queries lrc.red, LRCLIB and Netease concurrently with word-timed preference and new overlay highlighting. The biggest risk is a stalled word-capable provider holding the lookup for ~24 s despite the 6 s budget; CI (Frontend/Rust checks) is still running with no completed run yet.

Confidence: 3/5 — New resolve/ranking/yrc/segment logic is well unit-tested, but the timeout budget and two provider-fallback edges are untested and user-visible.

FindingLocation
🆕 🟡 MediumPer-request timeout stacks and blocks fast providerssrc-tauri/src/lib.rs:2343
🆕 🟡 MediumNon-404 lyric error aborts before trying next candidatesrc-tauri/src/lib.rs:2351
🆕 🔵 LowNetease instrumental marker becomes a misssrc-tauri/src/lib.rs:2527
Prompt for all open findings
  • In src-tauri/src/lib.rs around lines 1827–1854 and 2293–2370 and 2413–2512, enforce a 6 s total budget per provider (wrap each provider future with an overall timeout) because per-request timeouts stack sequentially and resolve() blocks fast line-synced answers while word-capable slots are pending.
  • In src-tauri/src/lib.rs around lines 2333–2364 (and the same pattern around 2467–2506), record lyric-fetch errors and continue to the next ranked candidate instead of immediate return Err, returning the error only when no candidate yields timed lyrics.
  • In src-tauri/src/lib.rs around lines 2487–2531, preserve the Netease instrumental signal by returning an instrumental LyricsResult when the raw file contains only the 纯音乐 marker instead of cleaning it to empty and returning Ok(None).
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]1mo ago

Review · 317416d

⚠️ 1 open finding

Queries lrc.red, LRCLIB and Netease concurrently with word-timed preference and new overlay highlighting. The remaining risk is a narrow instrumental false-positive via album-title equality; CI is still running on this SHA (last completed CI on 9bbb92d passed).

Confidence: 4/5 — All three prior findings are fixed and covered by new unit tests, leaving one Low edge with a concrete but uncommon trigger.

FindingLocation
🆕 🔵 LowAlbum match passes as exact title for instrumentalsrc-tauri/src/lib.rs:2546
✅ FixedPer-request timeout stacks and blocks fast providerssrc-tauri/src/lib.rs:1827
✅ FixedNon-404 lyric error aborts before trying next candidatesrc-tauri/src/lib.rs:1841
✅ FixedNetease instrumental marker becomes a misssrc-tauri/src/lib.rs:2620
Prompt for all open findings
  • In src-tauri/src/lib.rs around lines 2536-2548 (fetch_netease exact-title guard) and 2171-2197 (metadata_scores), fix the instrumental guard to compare only the track title because metadata_scores(...).0 is max(track score, album score) so an album equal to the playing title yields 4: compute exact-title from the candidate track name only (canonical track vs normalized playing title), keep ranking/duration unchanged, and return instrumental only on that track-only exact match.
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]1mo ago

Review · e7e96a7

✅ No blocking issues

Queries lrc.red, LRCLIB and Netease concurrently with word-timed preference and new overlay highlighting. The album-title instrumental false positive is now fixed; CI is still running on this SHA (last completed CI on 317416d passed).

Confidence: 4/5 — All prior findings are fixed and the delta is covered by a new unit test, but CI on the head SHA has not completed yet.

FindingLocation
✅ FixedAlbum match passes as exact title for instrumentalsrc-tauri/src/lib.rs:2558