Repository navigation
feat: 云盘上传 - #45
Merged
Merged
feat: 云盘上传#45
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
该 PR 为 SPlayer-Next 增加「云盘上传」能力:渲染层提供上传队列与弹窗交互,主进程通过网易云相关接口完成查重/秒传/直传 NOS,并通过 IPC 推送上传进度,最终刷新云盘列表。
Changes:
- 新增上传队列 store + 上传弹窗(选择文件、进度、重试/移除、清理已完成)
- 主进程新增云盘上传编排与 IPC:文件选择、逐首上传、进度节流推送、网易云 API 模块补齐
- 云盘页新增“上传”入口;播放器来源标签支持云盘;列表搜索对空字段更健壮
Reviewed changes
Copilot reviewed 21 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/stores/cloudUpload.ts | 新增上传队列与串行执行逻辑、容量预检、进度订阅与队列淘汰 |
| src/components/modals/CloudUploadDialog.vue | 新增上传弹窗 UI(选择文件、队列展示、重试/移除/清理) |
| src/pages/Cloud.vue | 云盘页新增“上传”按钮并挂载上传弹窗 |
| shared/types/cloudUpload.ts | 新增云盘上传相关共享类型与音频扩展名列表 |
| electron/preload/index.ts | 向渲染层暴露 cloud API(pickSongs/uploadSong/onUploadProgress) |
| electron/preload/index.d.ts | Window.api 增加 cloud: CloudUploadApi 类型声明 |
| electron/main/ipc/index.ts | 注册 cloud IPC handlers |
| electron/main/ipc/cloud.ts | 新增文件选择与上传 IPC,实现进度节流推送与错误收敛 |
| electron/main/services/cloudUpload.ts | 新增上传编排:查重→秒传导入/直传 NOS→提交信息→发布 |
| electron/main/utils/logger.ts | 新增 cloudLog scope |
| electron/main/apis/netease/index.ts | 新增上传相关接口到 NON_CACHEABLE |
| electron/main/apis/netease/modules/index.ts | 注册新增的上传相关网易云模块 |
| electron/main/apis/netease/modules/cloud_upload_check.ts | 新增:上传查重模块 |
| electron/main/apis/netease/modules/cloud_upload_check_v2.ts | 新增:秒传查重 v2 模块 |
| electron/main/apis/netease/modules/cloud_nos_token.ts | 新增:NOS token 申请模块 |
| electron/main/apis/netease/modules/cloud_upload_info.ts | 新增:提交云盘信息模块 |
| electron/main/apis/netease/modules/cloud_pub.ts | 新增:发布云盘模块 |
| electron/main/apis/netease/modules/cloud_song_import.ts | 新增:秒传导入落库模块 |
| src/i18n/locales/zh-CN.json | 新增云盘上传相关文案(中文) |
| src/i18n/locales/en-US.json | 新增云盘上传相关文案(英文) |
| src/components/player/FullPlayer/PlayerData.vue | 来源标签新增云盘识别(CLOUD) |
| src/components/list/SongList.vue | 搜索过滤逻辑对 title/artists 空值更健壮 |
| components.d.ts | 全局组件类型新增 CloudUploadDialog 等(但当前含疑似误生成项) |
Comment on lines
+83
to
+86
| next.status = "reading"; | ||
| next.progress = 0; | ||
| const res: CloudUploadResult = await window.api.cloud.uploadSong(next.path, next.id); | ||
| if (res.success) { |
Comment on lines
+41
to
+57
| const bindProgress = (): void => { | ||
| if (progressBound) return; | ||
| progressBound = true; | ||
| window.api.cloud.onUploadProgress((progress: CloudUploadProgress) => { | ||
| const item = items.value.find((it) => it.id === progress.uploadId); | ||
| if (!item) return; | ||
| if (progress.stage === "uploading") { | ||
| item.status = "uploading"; | ||
| item.progress = | ||
| progress.total > 0 | ||
| ? Math.min(99, Math.round((progress.loaded / progress.total) * 100)) | ||
| : 0; | ||
| } else if (progress.stage === "finishing") { | ||
| item.progress = 99; | ||
| } | ||
| }); | ||
| }; |
Comment on lines
+324
to
+325
| onUploadProgress: (callback: (progress: CloudUploadProgress) => void) => | ||
| subscribe<CloudUploadProgress>("cloud:upload-progress", callback), |
Comment on lines
+64
to
+70
| for (const item of items.value) { | ||
| if (removable > 0 && (item.status === "success" || item.status === "instant")) { | ||
| removable--; | ||
| continue; | ||
| } | ||
| kept.push(item); | ||
| } |
Comment on lines
+9
to
+10
| /** 进度事件节流间隔(ms) */ | ||
| const PROGRESS_THROTTLE_MS = 200; |
Comment on lines
+31
to
+33
| try { | ||
| const info = await stat(filePath); | ||
| songs.push({ path: filePath, name: path.basename(filePath), size: info.size }); |
Comment on lines
+45
to
+46
| let lastEmit = 0; | ||
| try { |
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.