diff --git a/publish/changeLog.md b/publish/changeLog.md index 48cc592a..a07ffb08 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -2,3 +2,4 @@ ### 修复 - 修复同步连接的处理问题 +- 修复记住播放进度的情况下,使用Scheme URL打开应用播放的歌曲进度没有被重置的问题 diff --git a/src/renderer/core/player/action.ts b/src/renderer/core/player/action.ts index e72130b3..77bb42e2 100644 --- a/src/renderer/core/player/action.ts +++ b/src/renderer/core/player/action.ts @@ -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) }) diff --git a/src/renderer/core/useApp/useDataInit.ts b/src/renderer/core/useApp/useDataInit.ts index ad5818e4..aca1cdc1 100644 --- a/src/renderer/core/useApp/useDataInit.ts +++ b/src/renderer/core/useApp/useDataInit.ts @@ -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 () => { diff --git a/src/renderer/store/list/listManage/action.ts b/src/renderer/store/list/listManage/action.ts index e8afa1c7..4645a677 100644 --- a/src/renderer/store/list/listManage/action.ts +++ b/src/renderer/store/list/listManage/action.ts @@ -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)) {