Conversation
- 将过程式代码重构为 DesktopLyricManager 类,封装状态与逻辑 - 提取通用方法如窗口状态检查、事件绑定与消息发送 - 优化主窗口交互时的鼠标穿透防抖逻辑 - 统一配置存储操作,减少重复代码
将 toggle-desktop-lyric-lock IPC 通信的参数从多个独立参数重构为单一对象参数,提高代码可读性和可扩展性。修改涉及主进程和渲染进程的多个文件,确保参数传递方式一致。
This comment was marked as outdated.
This comment was marked as outdated.
- 将文件操作、下载和音乐元数据处理逻辑提取到独立的服务类中 - 重构 ipc-file.ts 以使用新服务,减少代码重复并提高可维护性 - 在 SongCard 组件中使用 formatFileSize 格式化文件大小显示 - 公开 LocalMusicService 的 paths getter 和错误常量
- 将音乐库同步的扫描、封面处理与分块发送逻辑封装到 LocalMusicService.syncLibrary 方法 - 重构 MusicFileService 的元数据解析为分批处理以避免内存压力 - 将 DownloadService 的下载流程拆分为准备、执行、后处理等独立方法 - 简化 IPC 处理程序,移除重复的封面处理与分块逻辑
- 将 DownloadService 改为 EventEmitter 以支持进度事件 - 在 IPC 层添加下载映射,将进度事件转发给对应的渲染进程 - 重构下载流程,分离原始下载与元数据处理逻辑 - 使用 Electron net 模块下载专辑封面并临时存储 - 提供默认下载选项,增强代码健壮性
- 提取网络下载功能到独立的 network.ts 工具模块 - 提取艺术家格式化功能到独立的 artist.ts 工具模块 - 重构 DownloadService,分离下载逻辑与后处理逻辑 - 简化 ipc-file.ts 中的下载进度广播逻辑,移除 WebContents 映射 - 统一下载入口为 downloadMusic 方法,增强参数处理
使用展开运算符合并默认值时,如果传入的选项包含显式的 undefined,会错误地覆盖默认值。改为使用空值合并运算符(??)确保默认值只在选项为 null 或 undefined 时生效。 同时优化封面下载的文件名生成,通过 URL 解析去除查询参数,避免生成非法文件名。
优化媒体会话封面处理逻辑,在更新播放歌曲时传递已获取的封面数据给媒体会话管理器,避免对 blob URL 封面进行重复的网络请求。同时将 blob URL 的获取方式从 axios 统一为 fetch 以保持一致性。
refactor: 提取文件、下载和音乐文件服务以重构 IPC 模块 - 将文件操作、下载和音乐元数据处理逻辑提取到独立的服务类中 - 重构 ipc-file.ts 以使用新服务,减少代码重复并提高可维护性 - 在 SongCard 组件中使用 formatFileSize 格式化文件大小显示 - 公开 LocalMusicService 的 paths getter 和错误常量ipc 01
Member
|
/gemini review |
imsyy
approved these changes
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
refactor(lyric): 重构桌面歌词管理器为类结构以提升可维护性 - 将过程式代码重构为 DesktopLyricManager 类,封装状态与逻辑 - 提取通用方法如窗口状态检查、事件绑定与消息发送 - 优化主窗口交互时的鼠标穿透防抖逻辑 - 统一配置存储操作,减少重复代码