mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-24 08:07:23 +08:00
refactor(download): 重构下载系统,支持暂停/恢复/取消,修复歌词加载
- 新建 DownloadManager 类(主进程),每个任务独立 AbortController 控制 - 新建 Pinia useDownloadStore 作为渲染进程单一数据源 - 支持暂停/恢复/取消下载,支持断点续传(Range header) - 批量下载全部完成后发送汇总系统通知,单首不重复通知 - 并发数可配置(1-5),队列持久化(重启后恢复) - 修复下载列表不全、封面加载失败、通知重复等 bug - 修复本地/下载歌曲歌词加载:优先从 ID3/FLAC 元数据提取,API 作为 fallback - 删除 useDownloadStatus.ts,统一状态管理 - DownloadDrawer/DownloadPage 全面重写,移除 @apply 违规 - 新增 5 语言 i18n 键值(暂停/恢复/取消/排队中等)
This commit is contained in:
@@ -221,8 +221,8 @@ import alipay from '@/assets/alipay.png';
|
||||
import wechat from '@/assets/wechat.png';
|
||||
import Coffee from '@/components/Coffee.vue';
|
||||
import { SEARCH_TYPES, USER_SET_OPTIONS } from '@/const/bar-const';
|
||||
import { useDownloadStatus } from '@/hooks/useDownloadStatus';
|
||||
import { useZoom } from '@/hooks/useZoom';
|
||||
import { useDownloadStore } from '@/store/modules/download';
|
||||
import { useIntelligenceModeStore } from '@/store/modules/intelligenceMode';
|
||||
import { useNavTitleStore } from '@/store/modules/navTitle';
|
||||
import { useSearchStore } from '@/store/modules/search';
|
||||
@@ -243,7 +243,11 @@ const userSetOptions = ref(USER_SET_OPTIONS);
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
const intelligenceModeStore = useIntelligenceModeStore();
|
||||
const { downloadingCount, navigateToDownloads } = useDownloadStatus();
|
||||
const downloadStore = useDownloadStore();
|
||||
const downloadingCount = computed(() => downloadStore.downloadingCount);
|
||||
const navigateToDownloads = () => {
|
||||
router.push('/downloads');
|
||||
};
|
||||
const showDownloadButton = computed(
|
||||
() =>
|
||||
isElectron && (settingsStore.setData?.alwaysShowDownloadButton || downloadingCount.value > 0)
|
||||
|
||||
Reference in New Issue
Block a user