Skip to content
This repository was archived by the owner on Jul 17, 2026. It is now read-only.

🐞 fix: 修复解析QRC时丢失左括号的bug - #926

Merged
kazukokawagawa merged 1 commit into
SPlayer-Dev:devfrom
apoint123:fix/qrc-parsing
Feb 22, 2026
Merged

kazukokawagawa merged 1 commit into
SPlayer-Dev:devfrom
apoint123:fix/qrc-parsing

Conversation

@apoint123

Copy link
Copy Markdown
Member

修复了一个解析 QRC 歌词文件时左括号意外丢失的 bug

例如有歌词行为

[0,21260]Mine(0,1417) (1417,1417)((2834,1417)Illenium(4251,1417) (5668,1417)Remix(7085,1417))(8502,1417)

现在可以正确解析出 ((2834,1417) 的左括号而不会丢失了

Copilot AI review requested due to automatic review settings February 22, 2026 04:27
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @apoint123, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求修复了一个在解析 QRC 歌词文件时,歌词内容中的左括号会被错误地忽略或丢失的 bug。通过修改用于匹配歌词单词和时间戳的正则表达式,确保了所有字符,包括左括号,都能被正确地解析和保留,从而提高了歌词解析的准确性。

Highlights

  • 修复 QRC 歌词解析错误: 解决了 QRC 歌词文件解析时左括号意外丢失的问题。
  • 更新正则表达式: 调整了 QRC_WORD_PATTERN 正则表达式,以正确匹配歌词内容中的括号。
Changelog
  • src/utils/lyric/lyricParser.ts
    • 调整了文件顶部的导入语句顺序。
    • 更新了 QRC_WORD_PATTERN 正则表达式,以解决解析 QRC 歌词时左括号丢失的问题。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request effectively addresses the bug where the left parenthesis was lost during QRC lyric parsing. The change to the QRC_WORD_PATTERN regex from ([^(]*) to (.*?) correctly captures all characters, including parentheses, before the time-duration group. The reordering of imports is a minor stylistic change.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 修复了 QQ 音乐 QRC 逐字歌词解析时,歌词文本中紧邻时间标记前的左括号会被正则吞掉的问题,确保类似 ((2834,1417) 这种场景能保留前置的 ( 字符,从而提升 QRC 歌词解析的正确性。

Changes:

  • 调整 QRC 逐字解析正则 QRC_WORD_PATTERN,允许歌词文本中包含 ( 并避免丢失前置左括号
  • 轻微整理 lyricParser.ts 的 import 顺序

@kazukokawagawa
kazukokawagawa merged commit d9974fb into SPlayer-Dev:dev Feb 22, 2026
4 checks passed
@apoint123
apoint123 deleted the fix/qrc-parsing branch February 22, 2026 05:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account?