Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- **包管理器**: **严格使用 `pnpm`** (严禁使用 npm/yarn)
- **开发命令**: `pnpm dev` (预览代码)
- **代码质量**: 每次任务结束前,必须自动运行 `pnpm lint` 并修复所有问题,确保 0 错误、0 警告后方可交付。
- **提交之前**: 必须运行 `pnpm build` 和 `pnpm format` 并修复所有问题,确保 0 错误、0 警告后方可提交。

## 代码风格与规范

Expand Down
13 changes: 13 additions & 0 deletions src/core/resource/DownloadManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,19 @@ class DownloadManager {
this.processQueue();
}

public removeDownload(id: number | string) {
const dataStore = useDataStore();
// 如果正在下载,尝试取消(目前仅移除任务)
if (this.activeDownloads.has(id)) {
// TODO: 实现取消正在进行的下载任务
// 暂时只能从 UI 移除
}
// 从队列中移除
this.queue = this.queue.filter((task) => task.id !== id);
// 从 store 移除
dataStore.removeDownloadingSong(id);
}

public retryDownload(id: number | string) {
const dataStore = useDataStore();
const task = dataStore.downloadingSongs.find((s) => s.song.id === id);
Expand Down
Loading