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