Skip to content

Commit a76ce18

Browse files
committed
✨ feat: 更新下载管理逻辑,重置下载状态与进度信息
1 parent 472d357 commit a76ce18

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/utils/downloadManager.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,9 @@ class DownloadManager {
322322
if (!task) return;
323323

324324
// 重置任务状态与进度
325-
dataStore.resetDownloadingSong(songId);
325+
dataStore.updateDownloadStatus(songId, "downloading");
326+
// 重置进度信息
327+
dataStore.updateDownloadProgress(songId, 0, "0MB", "0MB");
326328

327329
// 重新加入队列
328330
this.queue.push({ song: task.song, quality: task.quality });

src/views/Download/downloading.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,11 @@
7171
</n-flex>
7272
</div>
7373
<!-- 操作 -->
74-
<div class="actions">
74+
<n-flex align="center" justify="center" class="actions">
7575
<n-button
7676
type="primary"
7777
secondary
7878
strong
79-
style="margin-right: 12px"
8079
@click="DownloadManager.retryDownload(item.song.id)"
8180
>
8281
<template #icon>
@@ -93,7 +92,7 @@
9392
<SvgIcon name="Close" />
9493
</template>
9594
</n-button>
96-
</div>
95+
</n-flex>
9796
</div>
9897
</n-scrollbar>
9998
</div>
@@ -250,6 +249,9 @@ const sortedDownloadingSongs = computed(() => {
250249
display: flex;
251250
justify-content: center;
252251
min-width: 120px;
252+
.n-button {
253+
border-radius: 8px;
254+
}
253255
}
254256
}
255257
}

0 commit comments

Comments
 (0)