mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-05-17 02:07:29 +08:00
fix: 重新解析功能修复缓存问题
This commit is contained in:
@@ -79,6 +79,7 @@ import { useMessage } from 'naive-ui';
|
||||
import { ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { CacheManager } from '@/api/musicParser';
|
||||
import { playMusic } from '@/hooks/MusicHook';
|
||||
import { audioService } from '@/services/audioService';
|
||||
import { usePlayerStore } from '@/store/modules/player';
|
||||
@@ -160,12 +161,18 @@ const directReparseMusic = async (source: Platform) => {
|
||||
isReparsing.value = true;
|
||||
currentReparsingSource.value = source;
|
||||
|
||||
const songId = Number(playMusic.value.id);
|
||||
|
||||
await CacheManager.clearMusicCache(songId);
|
||||
|
||||
// 更新选中的音源值为当前点击的音源
|
||||
const songId = String(playMusic.value.id);
|
||||
selectedSourcesValue.value = [source];
|
||||
|
||||
// 保存到localStorage
|
||||
localStorage.setItem(`song_source_${songId}`, JSON.stringify(selectedSourcesValue.value));
|
||||
localStorage.setItem(
|
||||
`song_source_${String(songId)}`,
|
||||
JSON.stringify(selectedSourcesValue.value)
|
||||
);
|
||||
|
||||
const success = await playerStore.reparseCurrentSong(source);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user