Skip to content

🐞fix(player/automix): 修复自动混音过渡时桌面歌词与 macOS 状态栏信息不更新的问题#903

Merged
imsyy merged 2 commits intoimsyy:devfrom
Pissofdvpe:dev-fix
Feb 20, 2026
Merged

🐞fix(player/automix): 修复自动混音过渡时桌面歌词与 macOS 状态栏信息不更新的问题#903
imsyy merged 2 commits intoimsyy:devfrom
Pissofdvpe:dev-fix

Conversation

@Pissofdvpe
Copy link
Copy Markdown
Contributor

  • 在 setupSongUI 函数中增加显式的元数据通知逻辑,确保所有平台歌词组件信息同步:
    • 调用 playerIpc.sendSongChange 主动通知桌面歌词更新歌曲名称与艺术家。
    • 在 macOS 平台发送 mac-statusbar:update-progress 消息,初始化状态栏进度与显示。
  • 解决平滑过渡模式下的数据竞态:
    • 修复 AutoMix 模式下底层音频加载先于 UI 切换,导致 canplay 事件触发时 musicStore.playSong 尚未更新的问题。
    • 通过在 UI 实际切换点再次主动推送元数据,覆盖之前由于竞态发送的旧歌信息,确保歌词组件信息准确。

- 在 setupSongUI 函数中增加显式的元数据通知逻辑,确保所有平台歌词组件信息同步:
  - 调用 playerIpc.sendSongChange 主动通知桌面歌词更新歌曲名称与艺术家。
  - 在 macOS 平台发送 mac-statusbar:update-progress 消息,初始化状态栏进度与显示。
- 解决平滑过渡模式下的数据竞态:
  - 修复 AutoMix 模式下底层音频加载先于 UI 切换,导致 canplay 事件触发时 musicStore.playSong 尚未更新的问题。
  - 通过在 UI 实际切换点再次主动推送元数据,覆盖之前由于竞态发送的旧歌信息,确保歌词组件信息准确。
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Pissofdvpe, 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!

此拉取请求解决了在自动混音过渡期间,桌面歌词和 macOS 状态栏信息未能及时更新的关键同步问题。它在播放器 UI 设置过程中引入了显式的元数据更新机制,并解决了一个导致显示过时歌曲信息的数据竞态问题,从而提升了平滑歌曲过渡的用户体验。

Highlights

  • 桌面歌词与 macOS 状态栏更新: 修复了在自动混音过渡期间,桌面歌词和 macOS 状态栏信息未能及时更新的问题,通过在 setupSongUI 函数中增加显式的元数据通知逻辑来确保信息同步。
  • 解决数据竞态: 解决了在 AutoMix 平滑过渡模式下,由于底层音频加载先于 UI 切换导致的数据竞态问题,确保歌词组件显示准确的歌曲信息。
Changelog
  • src/core/player/PlayerController.ts
    • 增加了在 Electron 环境下主动通知桌面歌词更新歌曲元数据的逻辑。
    • 为 macOS 平台添加了在自动混音过渡时更新状态栏进度的功能。
    • 修复了因数据竞态导致歌词信息不同步的问题。
Activity
  • 拉取请求已创建,等待审查。
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.

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Code Review

这个 PR 旨在修复在自动混音过渡期间桌面歌词和 macOS 状态栏信息不更新的问题。为此,代码中增加了显式发送元数据通知的逻辑。获取 album 并将其传递给 sendSongChange 的改动是正确的。关于更新 macOS 状态栏进度,审查意见中提出的问题和建议是有效的:代码使用了一个新的、未被处理的 IPC 通道 mac-statusbar:update-progress。建议使用现有的、已被处理的 IPC 机制来修正这个错误,这也能提高代码的一致性。

Comment thread src/core/player/PlayerController.ts Outdated
- 在 PlayerController.ts 的 setupSongUI 方法中,将手动通过 ipcRenderer.send 发送的 mac-statusbar:update-progress
  消息,替换为了调用项目中标准的 playerIpc.sendTaskbarProgressData 函数。
@imsyy imsyy merged commit f3f9bc6 into imsyy:dev Feb 20, 2026
@Pissofdvpe Pissofdvpe deleted the dev-fix branch February 21, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants