修复原始歌词存在偏移时,歌词偏移设置的重置未按预期工作的问题

This commit is contained in:
lyswhut
2022-05-09 14:07:31 +08:00
parent e859d39b2b
commit 784515e411
7 changed files with 43 additions and 24 deletions
+12 -3
View File
@@ -4,6 +4,7 @@ import {
getRandom,
checkPath,
getLyric as getStoreLyric,
getLyricRaw as getStoreLyricRaw,
setLyric,
setMusicUrl,
getMusicUrl as getStoreMusicUrl,
@@ -177,6 +178,14 @@ const getLyric = function(musicInfo, retryedSource = [], originMusic) {
})
}
const buildLyricInfo = async(lyricInfo, musicInfo) => {
const lyricRawInfo = await getStoreLyricRaw(musicInfo)
return {
...lyricInfo,
rawInfo: lyricRawInfo,
}
}
// getters
const getters = {
@@ -231,16 +240,16 @@ const actions = {
case 'kw':
break
default:
return lrcInfo
return buildLyricInfo(lrcInfo, musicInfo)
}
} else return lrcInfo
} else return buildLyricInfo(lrcInfo, musicInfo)
}
// lrcRequest = music[musicInfo.source].getLyric(musicInfo)
return getLyric.call(this, musicInfo).then(({ lyric, tlyric, lxlyric }) => {
// lrcRequest = null
commit('setLrc', { musicInfo, lyric, tlyric, lxlyric })
return { lyric, tlyric, lxlyric }
return buildLyricInfo({ lyric, tlyric, lxlyric }, musicInfo)
}).catch(err => {
// lrcRequest = null
return Promise.reject(err)