parse_lrc_metadata stops at the first ], so [ti:Vision [Radio Edit]] parses as the title Vision [Radio Edit. import_lyrics_files compares the tag against the song's title exactly, so such an .lrc matches no song and is reported unmatched.
] by bracket depth (find_tag_close) instead of taking the first one.[ti:], [ar:] and [al:] are kept — parse_lrc_metadata_keeps_brackets_inside_values.[ar:X][ti:Y] on one line still reads the first tag, and a value whose brackets never balance still falls back to the last ] — parse_lrc_metadata_handles_unbalanced_brackets_in_values..lrc matches on import — manual: 23 audio files and their .lrc files into an empty library on Windows, all 23 matched. The Vision [Radio Edit] title was unmatched before this change.cd src-tauri && cargo test — 1219 passed. Its 19 failures also fail on unmodified main in this environment. nextest isn't installed here.cargo clippy --all-targets -- -D warnings — its 2 errors also occur on unmodified main here, both outside the changed code.node --run lint and node --run build — pass; no frontend change.docs/references/contracts/*.md — no IPC command, payload or event changed.Closes #465
🤖 Generated with Claude Code
parse_lrc_metadata now preserves balanced brackets in [ti:], [ar:], and [al:] values. This allows LRC files with values such as Vision [Radio Edit] to match songs during lyrics import. Unbalanced bracket values retain the existing behavior.
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
No actionable comments were generated in the recent review. 🎉
Configuration used: Repository: thedavidweng/OpenKara/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID: 18b0e21d-20a2-487f-8690-8805f93dd4da
Reviewing files that changed from the base of the PR and between 2fc59a5d5f7480b8056118f59c3a894795da20dd and 8f7e0b25a101d45b44e7ca0f662ce0a17f82d2e9.
src-tauri/src/lyrics/parser.rsIncluded review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
parse_lrc_metadata now preserves balanced square brackets in metadata values. It falls back to the final closing bracket for unbalanced values. Tests cover title and album metadata.
LRC metadata parsing
| Layer / File(s) | Summary |
|---|---|
Metadata bracket handling src-tauri/src/lyrics/parser.rs | parse_lrc_metadata uses find_tag_close to locate the outer closing bracket. The helper tracks nested brackets and handles unbalanced values. Tests cover balanced and unbalanced title and album values. |
Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers: thedavidweng
Merge Risk: ⚪ Minimal · up to 8f7e0
This change preserves bracketed LRC metadata so matching lyrics can use the intended title and artist values. No actionable merge-blocking risk remains.
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title uses the valid Conventional Commits prefix "fix", includes a relevant optional scope, and clearly describes the LRC metadata bracket parsing correction. |
| Linked Issues check | ✅ Passed | Issue #465 requires balanced brackets in [ti:], [ar:], and [al:] values. parse_lrc_metadata now calls find_tag_close, which skips nested brackets and selects the outer closing bracket. The n… |
| Out of Scope Changes check | ✅ Passed | The pull request changes only src-tauri/src/lyrics/parser.rs. The helper modifies tag-close detection, and the added tests cover the linked parsing behavior. These changes directly support Issue #46… |
| Ipc Contract Update | ✅ Passed | The PR changes only src-tauri/src/lyrics/parser.rs. It updates parse_lrc_metadata behavior, adds the private find_tag_close helper, and adds tests. No public IPC command, payload, event, or sour… |
| No Type Escapes | ✅ Passed | The pull request changes only src-tauri/src/lyrics/parser.rs. The authoritative diff contains no TypeScript or TSX files, so it adds no as any, [@ts-ignore](/ts-ignore), or [@ts-expect-error](/ts-expect-error). |
| Acceptance Evidence | ✅ Passed | All three PR acceptance criteria have explicit evidence. Criterion 1 names parse_lrc_metadata_keeps_brackets_inside_values, and the changed file contains that regression test. Criterion 2 names `par… |
| Do Not Edit Changelog | ✅ Passed | The authoritative pull-request diff changes only src-tauri/src/lyrics/parser.rs. No CHANGELOG.md file is changed, so the custom check passes. |
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment [@coderabbitai](/coderabbitai) help to get the list of available commands.
This review did not finish. The model reached its output limit before it could write the review — a reasoning model can spend the whole budget thinking. Re-run the review, or lower the model's thinking effort, and it should get further. Any inline comments below are from an earlier review.
Workflows from forks require approval
CI will not run on this pull request until someone with write access on the target repository approves workflows for commit 8f7e0b2. Secrets stay withheld for fork PRs.
Waiting for a target-repo writer to approve.
Sign in to comment.