mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-13 22:20:51 +08:00
✨ feat: 优化歌曲下载逻辑
This commit is contained in:
@@ -95,7 +95,6 @@ import { getSongUrl } from '@/hooks/MusicListHook';
|
||||
import { useArtist } from '@/hooks/useArtist';
|
||||
import { audioService } from '@/services/audioService';
|
||||
import { usePlayerStore } from '@/store';
|
||||
import { useSettingsStore } from '@/store/modules/settings';
|
||||
import type { SongResult } from '@/type/music';
|
||||
import { getImgUrl, isElectron } from '@/utils';
|
||||
import { getImageBackground } from '@/utils/linearColor';
|
||||
@@ -286,14 +285,7 @@ const downloadMusic = async () => {
|
||||
try {
|
||||
isDownloading.value = true;
|
||||
|
||||
const settingsStore = useSettingsStore();
|
||||
const { unlimitedDownload } = settingsStore.setData;
|
||||
|
||||
const data = (await getSongUrl(
|
||||
props.item.id as number,
|
||||
cloneDeep(props.item),
|
||||
unlimitedDownload
|
||||
)) as any;
|
||||
const data = (await getSongUrl(props.item.id as number, cloneDeep(props.item), true)) as any;
|
||||
if (!data || !data.url) {
|
||||
throw new Error(t('songItem.message.getUrlFailed'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user