Repository navigation
feat: 下载 - #38
Merged
Merged
feat: 下载#38
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
本 PR 为 SPlayer-Next 增加「下载」能力:在渲染层解析下载源/歌词并入队,由主进程负责串行下载落盘、按模板命名、可选写入封面/元信息/歌词与侧车歌词文件,同时新增下载管理页与下载相关设置,并补充“关于软件”页。
Changes:
- 新增主进程下载管理服务(队列、持久化、进度广播、文件命名/去重/写标签/写歌词文件)及 IPC/数据库支撑。
- 新增渲染层下载入口(右键菜单/播放器/批量操作)、下载管理页面与下载任务镜像 store。
- 新增下载设置分类与歌词序列化(LRC/增强 LRC/TTML),并扩展“关于软件”自定义设置页。
Reviewed changes
Copilot reviewed 51 out of 55 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/quality.ts | 导出 QUALITY_LABELS 供下载音质菜单复用 |
| src/utils/lyric/serialize.ts | 新增下载用歌词序列化(LRC/增强 LRC/TTML) |
| src/utils/config.ts | 增加官网/作者主页常量导出 |
| src/types/settings-schema.ts | 设置 schema 支持隐藏描述、分类支持自定义 component |
| src/stores/download.ts | 新增下载任务镜像 store(list + onState/onProgress) |
| src/settings/schema.ts | 注册下载分类与“关于软件”自定义页分类 |
| src/settings/categories/download.ts | 新增下载设置分类(目录/音质/写入选项等) |
| src/services/lyricLoader.ts | 在线命中后增加本地 TTML 库回查 |
| src/services/downloadSource.ts | 新增下载源解析(流媒体/网易云/插件) |
| src/services/downloadLyric.ts | 新增下载用歌词拉取与格式识别 |
| src/services/audioSource.ts | 插件解析函数导出并支持传入音质档位 |
| src/router/index.ts | 增加 /download 路由 |
| src/pages/Download.vue | 新增下载管理页(tab、清空、播放全部等) |
| src/i18n/locales/zh-CN.json | 增加下载/关于页相关文案(中文) |
| src/i18n/locales/en-US.json | 增加下载/关于页相关文案(英文) |
| src/env.d.ts | 增加 APP_HOMEPAGE/APP_AUTHOR_URL 类型声明 |
| src/composables/useTrackMenu.ts | 右键菜单新增“下载”入口与子菜单音质选择 |
| src/composables/useMultiSelect.ts | 批量操作新增批量下载 |
| src/composables/useDownload.ts | 新增下载编排逻辑(解析→入队→重试→批量串行) |
| src/components/ui/SMenu.vue | 支持挂载时将选中项滚动到可视区中间 |
| src/components/settings/SettingsSearch.vue | 兼容 sections 可选与隐藏描述的搜索行为 |
| src/components/settings/SettingsMenu.vue | 启用 center-active-on-mount |
| src/components/settings/SettingsItem.vue | 支持隐藏描述行展示 |
| src/components/settings/SettingsContent.vue | 支持分类自定义 component 渲染 |
| src/components/settings/custom/DownloadDirConfig.vue | 新增下载目录选择/重置/打开组件 |
| src/components/settings/custom/AboutSettings.vue | 新增关于页:版本、更新、日志、贡献者、社区链接 |
| src/components/player/PlayerBar.vue | 播放器条菜单增加下载回调接入 |
| src/components/player/FullPlayer/index.vue | 全屏播放器增加下载按钮与音质选择 |
| src/components/list/SongList.vue | 列表批量栏增加下载按钮、右键下载接入 |
| src/components/list/DownloadList.vue | 新增下载任务列表(进度/播放/重试/删除等) |
| src/components/layout/SideBar.vue | 侧边栏新增下载入口与进行中角标 |
| src/apis/song/netease.ts | 新增网易云官方下载/播放接口下载源解析(含格式/体积) |
| src/apis/github.ts | 新增 GitHub contributors 拉取接口供关于页使用 |
| shared/types/settings.ts | 增加 DownloadSettings 并接入 SystemConfig |
| shared/types/download.ts | 新增跨进程下载共享类型(请求/任务/IPC API) |
| shared/defaults/settings.ts | 增加下载配置默认值 |
| electron/preload/index.ts | 暴露 download/system.openLogsDir 等 IPC API 给渲染层 |
| electron/preload/index.d.ts | 为 window.api 增加 download 与 openLogsDir 类型 |
| electron/main/utils/logger.ts | 增加 download scoped logger |
| electron/main/utils/filename.ts | 新增下载命名工具(模板/清洗/去重/扩展名推断) |
| electron/main/utils/config.ts | 增加 getDownloadDir(默认系统音乐目录/软件子目录) |
| electron/main/services/localLyricRepo.ts | 本地 TTML 仓库索引/命中策略调整并支持匹配缓存回查 |
| electron/main/services/downloadManager.ts | 新增下载管理核心服务(队列/落盘/写标签/持久化/广播) |
| electron/main/ipc/system.ts | 增加 system:openLogsDir IPC |
| electron/main/ipc/index.ts | 注册 download IPC handlers |
| electron/main/ipc/download.ts | 新增 download:* IPC(start/cancel/retry/remove/list/dir) |
| electron/main/database/index.ts | 增加 download_tasks 表与索引 |
| electron/main/database/downloads.ts | 新增下载任务表 CRUD/裁剪/中断标记 |
| electron/main/core/index.ts | 启动时初始化下载服务 |
| electron/main/apis/netease/modules/song_download_url.ts | 新增网易云下载接口模块封装 |
| electron/main/apis/netease/modules/index.ts | 注册 song_download_url 模块 |
| electron/main/apis/netease/index.ts | 将 song_download_url 标为 non-cacheable |
| electron.vite.config.ts | 注入 homepage/author.url 到渲染端常量 |
| components.d.ts | 更新自动组件类型声明(含新增组件/图标条目) |
Comment on lines
+113
to
+116
| const fileStream = fs.createWriteStream(partPath); | ||
| const reader = body.getReader(); | ||
| let received = 0; | ||
| let lastTs = 0; |
Comment on lines
+132
to
+138
| } finally { | ||
| fileStream.end(); | ||
| await new Promise<void>((resolve, reject) => { | ||
| fileStream.on("finish", () => resolve()); | ||
| fileStream.on("error", reject); | ||
| }); | ||
| } |
roarrabbit
pushed a commit
to roarrabbit/SPlayer-Next
that referenced
this pull request
Aug 27, 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.
No description provided.