#89

fix(lyrics): improve Japanese/dual-title lookup matching

OpenJustMarkDevwants to merge intofrom

Investigated per-song provider responses on lrc.red and hardened generic matching (no per-song hardcoding).

Provider findings (queried live: match.json with/without duration, search.json, /s/{isrc}.ttml):

  • #75 AIZO / King Gnu: provider returns the official recording first (JPU902504639) with a correct, internally consistent TTML. No client change applies; likely transient or player-duration mismatch.
  • #79 KUSUSHIKI / Mrs. GREEN APPLE: official (JPPO02501002) is in match.json, but the full dual title finds nothing via text search (verified empty); the Latin half alone finds official + a cover. New half fallback covers the case where match.json ever omits the official.
  • #80 On The Way / AiNA THE END: official (JPB602501972) first in match.json with correct TTML; same hardening as #79.
  • #82 JANE DOE duet: joined-artist match.json and text search return ONLY a vally.exe cover whose TTML is a near-empty placeholder (the reported Miss). The official (JPU902502822, credited '米津玄師, Utada') is found only via primary-artist text search. New primary-artist fallback merges it in and ranking puts it first. Fixes #82.
  • #84 Dance with STEEL BALL RUN / Yugo Kanno: provider has no such recording (match.json: unrelated tracks; search.json: empty; only unrelated fan songs for 'STEEL BALL RUN'). Nothing correct to display; commented on the issue.

Changes (src-tauri/src/lyrics.rs):

  • title_halves: split dual-script 'A - B' titles (spaced -, en/em dash) for fallback queries.
  • merge_half_hits: query both halves concurrently via text search when no exact hit; best-effort merge.
  • primary-artist text-search fallback in lrc_red_matches when no exact hit (fixes duets); benefits sync_words too.
  • extracted merge_text_hits (dedup by ISRC).
  • 5 new Rust unit tests (halves, merge, duet ranking, dual ranking, duet primary).

Validation: cargo test (73 passed), cargo fmt --check clean, cargo clippy clean. No TS touched.

Relates #75, Relates #79, Relates #80, Fixes #82. #84 is provider-missing (see issue comment).

Activity

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

Review · c0c4125

⚠️ 2 open findings

This PR adds dual-script half-title and primary-artist text-search fallbacks to lrc.red matching, fixing the JANE DOE duet miss; the biggest risk is a wrong-length exact hit suppressing those new fallbacks before ranking drops it.

Confidence: 3/5 — CI is green and the new paths have unit tests, but the Medium finding can still produce a real miss for duets.

FindingLocation
🆕 🟡 MediumWrong-duration exact hit suppresses fallbacks, then gets filteredsrc-tauri/src/lyrics.rs:614
🆕 🔵 LowDual-title split uses the leftmost same-kind dashsrc-tauri/src/lyrics.rs:673
Prompt for all open findings
  • In src-tauri/src/lyrics.rs around lines 606-620, the halves and primary-artist fallbacks are skipped when duration-blind has_exact_title is true on unranked merged hits while final rank_matches filters by duration; rank before gating or pass duration_ms into has_exact_title.
  • In src-tauri/src/lyrics.rs around lines 668-680, title_halves uses split_once instead of rsplit_once; switch to rsplit_once so repeated identical spaced dashes split rightmost.
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 · 4510fd7

✅ No blocking issues

Adds half-title and primary-artist text-search fallbacks to lrc.red matching to fix dual-script and duet misses. The biggest remaining risk was extra queries being skipped by a wrong-length hit, now gated on duration.

Confidence: 4/5 — both prior findings verified fixed in code with covering unit tests, though head CI was still running.

FindingLocation
✅ FixedWrong-duration exact hit suppresses fallbacks, then gets filteredsrc-tauri/src/lyrics.rs:614
✅ FixedDual-title split uses the leftmost same-kind dashsrc-tauri/src/lyrics.rs:673