Skip to content

fix(cover): enhance loading reliability and format compatibility#968

Open
kid141252010 wants to merge 1 commit intoimsyy:devfrom
kid141252010:feat/cover-fix
Open

fix(cover): enhance loading reliability and format compatibility#968
kid141252010 wants to merge 1 commit intoimsyy:devfrom
kid141252010:feat/cover-fix

Conversation

@kid141252010
Copy link

@kid141252010 kid141252010 commented Mar 4, 2026

(疑似是在我改了一堆东西 然后开代理的情况下复现的:在线封面开代理无法显示。就让AI改了点 不确定影响了什么)

Description

该 PR 旨在解决封面图片加载失败及状态不同步的问题。

主要改动:

  • s-image 组件增强: 引入了加载失败重试机制。
  • 格式与代理兼容: 处理了更多图片格式,并对本地/安全域名的图片请求执行代理绕过,修复由于代理设置导致的封面无法加载。
  • 状态同步: 修复了歌词清理时可能出现的状态残留 Bug。

@kid141252010 kid141252010 changed the title 封面加载与状态修复 fix(cover): enhance loading reliability and format compatibility Mar 4, 2026
@gemini-code-assist
Copy link
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!

此 PR 旨在全面提升应用程序中封面图片的加载体验,通过引入重试机制和优化代理配置,确保图片在各种网络环境下都能可靠显示。同时,它还解决了歌词清理过程中可能导致的状态不同步问题,从而提高了整体的用户体验和系统稳定性。

Highlights

  • s-image 组件增强: 引入了加载失败重试机制,提升封面图片加载的健壮性。
  • 格式与代理兼容性: 增加了对更多图片格式的处理,并为特定音乐域名和本地资源配置了代理绕过规则,以解决代理导致的封面加载问题。
  • 状态同步修复: 修复了歌词清理时可能出现的状态残留错误。
Changelog
  • electron/main/ipc/ipc-system.ts
    • 在设置代理时,为 *.music.126.net*.music.163.com 和本地资源添加了代理绕过规则。
    • 在代理测试函数中也应用了相同的代理绕过规则。
  • electron/main/windows/main-window.ts
    • 在主窗口初始化时,如果存在代理设置,则应用代理绕过规则以确保特定资源直连。
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
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 通过引入代理绕过规则,有效解决了封面图片加载失败和代理兼容性问题,增强了应用的稳定性。同时,对 s-image 组件的增强和状态同步的修复也提升了用户体验。

store.set("proxy", proxyRules);
mainWin?.webContents.session.setProxy({ proxyRules });
// 直连图片与核心资源,绕过代理避免跨域与防盗链拦截
const proxyBypassRules = "*.music.126.net;*.music.163.com;<local>";
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

proxyBypassRules 字符串 ("*.music.126.net;*.music.163.com;<local>") 在 set-proxytest-proxymain-window 的初始化逻辑中重复定义。为了提高可维护性并遵循 DRY (Don't Repeat Yourself) 原则,建议将其提取为一个共享常量,例如在 electron/main/utils/config.ts 中定义,并在需要的地方导入使用。

Suggested change
const proxyBypassRules = "*.music.126.net;*.music.163.com;<local>";
const proxyBypassRules = PROXY_BYPASS_RULES;

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.

1 participant