Skip to content

fix(SongMenu): 「下一首播放」的显示未按预期#997

Merged
apoint123 merged 1 commit into
SPlayer-Dev:devfrom
MoYingJi:pr/fc
Mar 15, 2026
Merged

fix(SongMenu): 「下一首播放」的显示未按预期#997
apoint123 merged 1 commit into
SPlayer-Dev:devfrom
MoYingJi:pr/fc

Conversation

@MoYingJi
Copy link
Copy Markdown
Collaborator

index 应该是歌曲在歌曲列表中的,而不是播放列表中的,这里却用这个 index 去和播放列表里的 playIndex 比较,是完全错误的

Copilot AI review requested due to automatic review settings March 15, 2026 00:54
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

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

此拉取请求旨在修复歌曲菜单中「下一首播放」显示不准确的问题。此前,判断当前播放歌曲的逻辑存在缺陷,错误地将歌曲列表的索引与播放列表的索引进行比较。本次更改引入了一个新的辅助函数来准确比较歌曲对象,并更新了菜单的判断逻辑,从而确保了当前播放歌曲的正确识别和显示。

Highlights

  • 新增歌曲比较函数: 添加了 isSameSong 辅助函数,用于根据歌曲的 idpath 准确判断两首歌曲是否相同。
  • 修复当前播放歌曲判断逻辑: 修正了歌曲菜单中判断当前播放歌曲的逻辑,从错误的基于索引的比较改为使用新 isSameSong 函数进行基于歌曲对象的比较。
  • 解决「下一首播放」显示问题: 解决了「下一首播放」显示不符合预期的问题,确保了歌曲菜单能正确识别当前播放的歌曲。
Changelog
  • src/composables/useSongMenu.ts
    • 新增了 isSameSong 函数,用于比较两首歌曲是否相同。
    • 更新了 isCurrent 变量的计算方式,使其使用 isSameSong 函数来判断当前播放歌曲。
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 修复了「下一首播放」菜单项的显示逻辑,旧的实现通过比较列表索引来判断,但这在不同列表下会出错,做得很好。新的实现直接比较歌曲对象,这更加健壮。不过,我在新的 isSameSong 辅助函数中发现一个潜在问题,它无法正确处理 ID 为 0 的歌曲。我留了一条建议来修复这个问题。

Comment thread src/composables/useSongMenu.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

修复歌曲菜单中「下一首播放」的显示逻辑:不再用歌曲列表的 index 去和播放列表的 playIndex 比较,改为基于“当前播放歌曲”与“目标歌曲”是否为同一首来判断,从而避免显示不符合预期。

Changes:

  • 新增 isSameSong 辅助方法,用 id / path 判断两首歌是否相同
  • isCurrent 判断从索引比较改为歌曲实体比较,影响「下一首播放」等菜单项的显示条件

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/composables/useSongMenu.ts Outdated
`index` 应该是歌曲在**歌曲列表**中的,而不是**播放列表**中的,这里却用这个 `index` 去和播放列表里的 `playIndex` 比较,是完全错误的
@apoint123 apoint123 merged commit 6bce76e into SPlayer-Dev:dev Mar 15, 2026
@MoYingJi MoYingJi deleted the pr/fc branch March 15, 2026 17:14
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.

3 participants