移除kg源的歌词文件开头的空白字符串
parent
897107ca23
commit
5c96c83f98
|
@ -1,11 +1,3 @@
|
||||||
### 新增
|
|
||||||
|
|
||||||
- 播放详情页新增歌曲评论加载显示(某些平台暂不支持显示子评论)
|
|
||||||
|
|
||||||
### 优化
|
### 优化
|
||||||
|
|
||||||
- 修改播放详情页的歌曲图片的显示效果
|
- 移除kg源的歌词文件开头的空白字符串
|
||||||
|
|
||||||
### 修复
|
|
||||||
|
|
||||||
- 修复小芸源音乐搜索结果最多只有20条搜索结果的问题
|
|
||||||
|
|
|
@ -667,23 +667,15 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setLrc(targetSong) {
|
setLrc(targetSong) {
|
||||||
this.musicInfo.lrc = targetSong.lrc
|
this.getLrc(targetSong).then(() => {
|
||||||
this.musicInfo.tlrc = targetSong.tlrc
|
this.musicInfo.lrc = targetSong.lrc
|
||||||
|
this.musicInfo.tlrc = targetSong.tlrc
|
||||||
let lrcP = this.musicInfo.lrc && this.musicInfo.tlrc != null
|
}).catch(() => {
|
||||||
? Promise.resolve()
|
this.status = this.statusText = this.$t('core.player.lyric_error')
|
||||||
: this.getLrc(targetSong).then(() => {
|
}).finally(() => {
|
||||||
this.musicInfo.lrc = targetSong.lrc
|
this.handleUpdateWinLyricInfo('lyric', { lrc: this.musicInfo.lrc, tlrc: this.musicInfo.tlrc })
|
||||||
this.musicInfo.tlrc = targetSong.tlrc
|
this.setLyric()
|
||||||
})
|
})
|
||||||
|
|
||||||
lrcP
|
|
||||||
.catch(() => {
|
|
||||||
this.status = this.statusText = this.$t('core.player.lyric_error')
|
|
||||||
}).finally(() => {
|
|
||||||
this.handleUpdateWinLyricInfo('lyric', { lrc: this.musicInfo.lrc, tlrc: this.musicInfo.tlrc })
|
|
||||||
this.setLyric()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
handleRemoveMusic() {
|
handleRemoveMusic() {
|
||||||
this.stopPlay()
|
this.stopPlay()
|
||||||
|
|
|
@ -59,6 +59,15 @@ const actions = {
|
||||||
},
|
},
|
||||||
getLrc({ commit, state }, musicInfo) {
|
getLrc({ commit, state }, musicInfo) {
|
||||||
if (lrcRequest && lrcRequest.cancelHttp) lrcRequest.cancelHttp()
|
if (lrcRequest && lrcRequest.cancelHttp) lrcRequest.cancelHttp()
|
||||||
|
if (musicInfo.lrc && musicInfo.tlrc != 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 })
|
||||||
|
}
|
||||||
|
return Promise.resolve()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
lrcRequest = music[musicInfo.source].getLyric(musicInfo)
|
lrcRequest = music[musicInfo.source].getLyric(musicInfo)
|
||||||
return lrcRequest.promise.then(({ lyric, tlyric }) => {
|
return lrcRequest.promise.then(({ lyric, tlyric }) => {
|
||||||
lrcRequest = null
|
lrcRequest = null
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { decodeLyric } from './util'
|
||||||
|
|
||||||
const parseLyric = str => {
|
const parseLyric = str => {
|
||||||
str = str.replace(/(?:<\d+,\d+,\d+>|\r)/g, '')
|
str = str.replace(/(?:<\d+,\d+,\d+>|\r)/g, '')
|
||||||
|
if (str.startsWith('\ufeff[id:$00000000]')) str = str.replace('\ufeff[id:$00000000]\n', '')
|
||||||
let trans = str.match(/\[language:([\w=\\/+]+)\]/)
|
let trans = str.match(/\[language:([\w=\\/+]+)\]/)
|
||||||
let tlyric
|
let tlyric
|
||||||
if (trans) {
|
if (trans) {
|
||||||
|
|
Loading…
Reference in New Issue