修复记住播放进度的情况下,使用Scheme URL打开应用播放的歌曲进度没有被重置的问题

pull/1229/head
lyswhut 2023-02-22 15:43:45 +08:00
parent 60b357e6f9
commit fe7bc924da
4 changed files with 12 additions and 4 deletions

View File

@ -2,3 +2,4 @@
### 修复
- 修复同步连接的处理问题
- 修复记住播放进度的情况下使用Scheme URL打开应用播放的歌曲进度没有被重置的问题

View File

@ -109,6 +109,7 @@ const handleRestorePlay = async(restorePlayInfo: LX.Player.SavedPlayInfo) => {
if (!musicInfo) return
setImmediate(() => {
if (musicInfo.id != playMusicInfo.musicInfo?.id) return
window.app_event.setProgress(appSetting['player.isSavePlayTime'] ? restorePlayInfo.time : 0, restorePlayInfo.maxTime)
})

View File

@ -8,6 +8,7 @@ import useInitUserApi from './useInitUserApi'
import { play, playList } from '@renderer/core/player'
import { onBeforeUnmount } from '@common/utils/vueTools'
import { appSetting } from '@renderer/store/setting'
import { playMusicInfo } from '@renderer/store/player/state'
const initPrevPlayInfo = async() => {
const info = await getPlayInfo()
@ -18,7 +19,13 @@ const initPrevPlayInfo = async() => {
window.lx.restorePlayInfo = info
playList(info.listId, info.index)
if (appSetting['player.startupAutoPlay']) setTimeout(play)
if (appSetting['player.startupAutoPlay']) {
const musicInfo = playMusicInfo.musicInfo
if (!musicInfo) return
setTimeout(() => {
if (musicInfo.id == playMusicInfo.musicInfo?.id) play()
})
}
}
export default () => {

View File

@ -128,9 +128,8 @@ export const listDataOverwrite = ({ defaultList, loveList, userList, tempList }:
overwriteMusicList(LIST_IDS.DEFAULT, defaultList)
updatedListIds.push(LIST_IDS.DEFAULT)
}
if (allMusicList.has(LIST_IDS.LOVE)) {
overwriteMusicList(LIST_IDS.LOVE, loveList)
}
overwriteMusicList(LIST_IDS.LOVE, loveList)
updatedListIds.push(LIST_IDS.LOVE)
if (tempList && allMusicList.has(LIST_IDS.TEMP)) {