diff --git a/publish/changeLog.md b/publish/changeLog.md index 760fbcca..9034a368 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -27,6 +27,7 @@ Linux 系统至少需要 GLIBC_2.29 版本才能运行, - 修复获取自定义环境音效预设列表逻辑问题 - 修复 m4a 文件歌曲内嵌歌词无法读取的问题(#2090) - 修复 windows 任务管理器中的进程名显示为描述的问题(#2147) +- 修复本地歌曲同名歌词文件调整偏移时间后,下次再播放时调整的设置未被应用的问题(#2139) ### 变更 diff --git a/src/renderer/core/music/local.ts b/src/renderer/core/music/local.ts index 4f38f1b2..76113f65 100644 --- a/src/renderer/core/music/local.ts +++ b/src/renderer/core/music/local.ts @@ -137,7 +137,8 @@ export const getLyricInfo = async({ musicInfo, isRefresh, onToggleSource = () => }): Promise => { if (!isRefresh) { const [lyricInfo, fileLyricInfo] = await Promise.all([getCachedLyricInfo(musicInfo), window.lx.worker.main.getMusicFileLyric(musicInfo.meta.filePath)]) - if (lyricInfo?.lyric && lyricInfo.lyric != lyricInfo.rawlrcInfo.lyric) { + // console.log(lyricInfo, fileLyricInfo) + if (lyricInfo?.lyric && lyricInfo.lyric != fileLyricInfo?.lyric) { // 存在已编辑歌词 return buildLyricInfo({ ...lyricInfo, rawlrcInfo: fileLyricInfo ?? lyricInfo.rawlrcInfo }) } diff --git a/src/renderer/core/music/utils.ts b/src/renderer/core/music/utils.ts index 9e2b9b3d..561ab26e 100644 --- a/src/renderer/core/music/utils.ts +++ b/src/renderer/core/music/utils.ts @@ -125,30 +125,33 @@ export const buildLyricInfo = async(lyricInfo: MakeOptional => { let lrcInfo = await getStoreLyric(musicInfo) // lrcInfo = {} as unknown as LX.Player.LyricInfo - if (existTimeExp.test(lrcInfo.lyric) && lrcInfo.tlyric != null) { - // if (musicInfo.lrc.startsWith('\ufeff[id:$00000000]')) { - // let str = musicInfo.lrc.replace('\ufeff[id:$00000000]\n', '') - // commit('setLrc', { musicInfo, lyric: str, tlyric: musicInfo.tlrc, lxlyric: musicInfo.tlrc }) - // } else if (musicInfo.lrc.startsWith('[id:$00000000]')) { - // let str = musicInfo.lrc.replace('[id:$00000000]\n', '') - // commit('setLrc', { musicInfo, lyric: str, tlyric: musicInfo.tlrc, lxlyric: musicInfo.tlrc }) - // } + if (existTimeExp.test(lrcInfo.lyric)) { + if (lrcInfo.tlyric != null) { + // if (musicInfo.lrc.startsWith('\ufeff[id:$00000000]')) { + // let str = musicInfo.lrc.replace('\ufeff[id:$00000000]\n', '') + // commit('setLrc', { musicInfo, lyric: str, tlyric: musicInfo.tlrc, lxlyric: musicInfo.tlrc }) + // } else if (musicInfo.lrc.startsWith('[id:$00000000]')) { + // let str = musicInfo.lrc.replace('[id:$00000000]\n', '') + // commit('setLrc', { musicInfo, lyric: str, tlyric: musicInfo.tlrc, lxlyric: musicInfo.tlrc }) + // } - if (lrcInfo.lxlyric == null) { - switch (musicInfo.source) { // 以下源支持lxlyric 重新获取 - case 'kg': - case 'kw': - case 'mg': - case 'wy': - case 'tx': - break - default: - return lrcInfo - } - } else if (lrcInfo.rlyric == null) { - // 以下源支持 rlyric 重新获取 - if (!['wy', 'kg', 'tx'].includes(musicInfo.source)) return lrcInfo - } else return lrcInfo + if (lrcInfo.lxlyric == null) { + switch (musicInfo.source) { // 以下源支持lxlyric 重新获取 + case 'kg': + case 'kw': + case 'mg': + case 'wy': + case 'tx': + break + default: + return lrcInfo + } + } else if (lrcInfo.rlyric == null) { + // 以下源支持 rlyric 重新获取 + if (!['wy', 'kg', 'tx'].includes(musicInfo.source)) return lrcInfo + } else return lrcInfo + } + if (musicInfo.source == 'local') return lrcInfo } return null }