修复问题

pull/930/merge
lyswhut 2022-01-08 01:25:05 +08:00
parent fb3eced1fb
commit 3f98c332bd
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import { useCommit, useAction, onBeforeUnmount, useRouter, useI18n } from '@renderer/utils/vueTools' import { useCommit, useAction, onBeforeUnmount, useRouter, useI18n, markRaw } from '@renderer/utils/vueTools'
import { base as eventBaseName } from '@renderer/event/names' import { base as eventBaseName } from '@renderer/event/names'
import { getEnvParams, clearEnvParamsDeeplink } from '@renderer/utils/tools' import { getEnvParams, clearEnvParamsDeeplink } from '@renderer/utils/tools'
import { decodeName } from '@renderer/utils' import { decodeName } from '@renderer/utils'
@ -78,7 +78,7 @@ export default () => {
} }
} }
const handleOpenMusic = _musicInfo => { const handlePlayMusic = _musicInfo => {
const musicInfo = { const musicInfo = {
..._musicInfo, ..._musicInfo,
singer: decodeName(_musicInfo.singer), singer: decodeName(_musicInfo.singer),
@ -91,6 +91,7 @@ export default () => {
for (const type of musicInfo.types) { for (const type of musicInfo.types) {
musicInfo._types[type.type] = { size: type.size } musicInfo._types[type.type] = { size: type.size }
} }
markRaw(musicInfo)
const isPlaying = !!playMusicInfo.musicInfo const isPlaying = !!playMusicInfo.musicInfo
setTempPlayList([{ listId: '__temp__', musicInfo, isTop: true }]) setTempPlayList([{ listId: '__temp__', musicInfo, isTop: true }])
if (isPlaying) playNext() if (isPlaying) playNext()
@ -202,7 +203,7 @@ export default () => {
musicInfo.types = qualityFilter(musicInfo.source, musicInfo.types) musicInfo.types = qualityFilter(musicInfo.source, musicInfo.types)
switch (action) { switch (action) {
case 'play': case 'play':
handleOpenMusic(musicInfo) handlePlayMusic(musicInfo)
break break
default: throw new Error('Unknown action: ' + action) default: throw new Error('Unknown action: ' + action)
} }