fix: 修复播放并发控制死代码、shallowRef响应式、歌词IPC高频调用 (H-005/H-006/H-009)

- H-005: 删除 playerCore.ts 中无效的 playInProgress 局部变量
- H-006: fetchSongs 修改 shallowRef 元素后添加 triggerRef 触发更新
- H-009: sendLyricToWin 从每秒20次全量发送改为每秒5次轻量更新
This commit is contained in:
alger
2026-03-12 18:07:20 +08:00
parent 72fabc6d12
commit ec8a07576f
3 changed files with 19 additions and 13 deletions
+3 -1
View File
@@ -1,7 +1,7 @@
import { useThrottleFn } from '@vueuse/core';
import { createDiscreteApi } from 'naive-ui';
import { defineStore, storeToRefs } from 'pinia';
import { computed, ref, shallowRef } from 'vue';
import { computed, ref, shallowRef, triggerRef } from 'vue';
import i18n from '@/../i18n/renderer';
import { useSongDetail } from '@/hooks/usePlayerHooks';
@@ -83,6 +83,8 @@ export const usePlaylistStore = defineStore(
playList.value[startIndex + index] = song;
}
});
// 触发 shallowRef 响应式更新(直接修改元素不会自动触发)
triggerRef(playList);
// 预加载下一首歌曲的音频和封面
if (nextSong) {