修复本地歌曲同名歌词文件调整偏移时间后,下次再播放时调整的设置未被应用的问题(#2139)

pull/2166/head
lyswhut 2024-12-07 16:59:48 +08:00
parent 08da7a37e6
commit 63b2c2fb2f
3 changed files with 29 additions and 24 deletions

View File

@ -27,6 +27,7 @@ Linux 系统至少需要 GLIBC_2.29 版本才能运行,
- 修复获取自定义环境音效预设列表逻辑问题
- 修复 m4a 文件歌曲内嵌歌词无法读取的问题(#2090
- 修复 windows 任务管理器中的进程名显示为描述的问题(#2147
- 修复本地歌曲同名歌词文件调整偏移时间后,下次再播放时调整的设置未被应用的问题(#2139
### 变更

View File

@ -137,7 +137,8 @@ export const getLyricInfo = async({ musicInfo, isRefresh, onToggleSource = () =>
}): Promise<LX.Player.LyricInfo> => {
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 })
}

View File

@ -125,7 +125,8 @@ export const buildLyricInfo = async(lyricInfo: MakeOptional<LX.Player.LyricInfo,
export const getCachedLyricInfo = async(musicInfo: LX.Music.MusicInfo): Promise<LX.Player.LyricInfo | null> => {
let lrcInfo = await getStoreLyric(musicInfo)
// lrcInfo = {} as unknown as LX.Player.LyricInfo
if (existTimeExp.test(lrcInfo.lyric) && lrcInfo.tlyric != null) {
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 })
@ -150,6 +151,8 @@ export const getCachedLyricInfo = async(musicInfo: LX.Music.MusicInfo): Promise<
if (!['wy', 'kg', 'tx'].includes(musicInfo.source)) return lrcInfo
} else return lrcInfo
}
if (musicInfo.source == 'local') return lrcInfo
}
return null
}