Skip to content

feat: 云盘上传 - #45

Merged
imsyy merged 5 commits into
devfrom
feat/cloud-upload
Jun 22, 2026
Merged

imsyy merged 5 commits into
devfrom
feat/cloud-upload

Conversation

@imsyy

@imsyy imsyy commented Jun 21, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 21, 2026 14:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 thread src/stores/cloudUpload.ts Outdated
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 thread src/stores/cloudUpload.ts
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 thread electron/preload/index.ts
Comment on lines +324 to +325
onUploadProgress: (callback: (progress: CloudUploadProgress) => void) =>
subscribe<CloudUploadProgress>("cloud:upload-progress", callback),
Copilot AI review requested due to automatic review settings June 22, 2026 02:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 24 out of 26 changed files in this pull request and generated 4 comments.

Comment thread src/stores/cloudUpload.ts
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 {
@imsyy
imsyy merged commit 10d2194 into dev Jun 22, 2026
5 checks passed
@imsyy
imsyy deleted the feat/cloud-upload branch June 22, 2026 04:11
roarrabbit pushed a commit to roarrabbit/SPlayer-Next that referenced this pull request Aug 27, 2026
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.

2 participants