-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: 🐛 修复本地播放模式逻辑 #701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 🐛 修复本地播放模式逻辑 #701
Conversation
Summary of ChangesHello @awsl1414, 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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
你好,感谢你的贡献!这次的修改解决了本地播放模式下随机播放无法跳过心动模式的问题。代码逻辑是正确的,通过检查播放列表中是否存在本地歌曲来决定是否跳过心动模式。我有一个关于代码结构的建议,将这部分逻辑移到 PlayModeManager 中可能会使代码职责更清晰。具体请看我的评论。
| const hasLocalSongs = dataStore.playList.some((song) => song.path); | ||
|
|
||
| // 预判下一个模式 | ||
| const nextMode = mode ?? this.playModeManager.calculateNextShuffleMode(currentMode); | ||
| let nextMode = mode ?? this.playModeManager.calculateNextShuffleMode(currentMode); | ||
|
|
||
| // 如果播放列表包含本地歌曲,跳过心动模式 | ||
| if (hasLocalSongs && nextMode === "heartbeat") { | ||
| nextMode = "off"; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
随机播放按钮只能开启或关闭,不能切换为心动模式
大概率修复 #694