Merge branch 'dev' of github.com:lyswhut/lx-music-desktop into dev
commit
2f528d2a03
|
@ -1,11 +1,20 @@
|
||||||
|
### 新增
|
||||||
|
|
||||||
|
- 播放控制栏开启/关闭桌面歌词按钮 新增右击按钮时锁定/解锁桌面歌词功能
|
||||||
|
|
||||||
### 优化
|
### 优化
|
||||||
|
|
||||||
- 优化我的列表滚动条位置的保存逻辑
|
- 优化我的列表滚动条位置的保存逻辑
|
||||||
- 更新设置-备份与恢复功能的描述
|
- 更新设置-备份与恢复功能的描述
|
||||||
- 修复初始化搜索历史列表功能
|
- 优化软件内鼠标悬停的提示界面
|
||||||
- 修复重启软件后试听列表与收藏列表无法恢复上次的滚动位置的问题
|
|
||||||
|
|
||||||
### 修复
|
### 修复
|
||||||
|
|
||||||
- 修复桌面歌词窗口不允许拖出桌面之外的位置计算偏移Bug
|
- 修复桌面歌词窗口不允许拖出桌面之外的位置计算偏移Bug
|
||||||
- 修复网易云KTV嗨榜无法加载的问题
|
- 修复网易云KTV嗨榜无法加载的问题
|
||||||
|
- 修复初始化搜索历史列表功能
|
||||||
|
- 修复重启软件后试听列表与收藏列表无法恢复上次的滚动位置的问题
|
||||||
|
- 修复歌曲封面无法嵌入的Bug
|
||||||
|
- 修复酷狗歌词格式问题
|
||||||
|
- 修复关闭切换动画时从搜索候选列表点击内容无效的问题
|
||||||
|
|
||||||
|
|
|
@ -94,6 +94,7 @@ export default {
|
||||||
this.$refs.dom_input.focus()
|
this.$refs.dom_input.focus()
|
||||||
},
|
},
|
||||||
handleTemplistClick(index) {
|
handleTemplistClick(index) {
|
||||||
|
console.log(index)
|
||||||
this.sendEvent('listClick', index)
|
this.sendEvent('listClick', index)
|
||||||
},
|
},
|
||||||
handleFocus() {
|
handleFocus() {
|
||||||
|
@ -101,8 +102,10 @@ export default {
|
||||||
this.sendEvent('focus')
|
this.sendEvent('focus')
|
||||||
},
|
},
|
||||||
handleBlur() {
|
handleBlur() {
|
||||||
this.focus = false
|
setTimeout(() => {
|
||||||
this.sendEvent('blur')
|
this.focus = false
|
||||||
|
this.sendEvent('blur')
|
||||||
|
}, 80)
|
||||||
},
|
},
|
||||||
handleSearch() {
|
handleSearch() {
|
||||||
this.hideList()
|
this.hideList()
|
||||||
|
|
|
@ -158,6 +158,9 @@ const getUrl = (downloadInfo, isRefresh) => {
|
||||||
return url && !isRefresh ? Promise.resolve({ url }) : music[downloadInfo.musicInfo.source].getMusicUrl(downloadInfo.musicInfo, downloadInfo.type).promise
|
return url && !isRefresh ? Promise.resolve({ url }) : music[downloadInfo.musicInfo.source].getMusicUrl(downloadInfo.musicInfo, downloadInfo.type).promise
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修复 1.1.x版本 酷狗源歌词格式
|
||||||
|
const fixKgLyric = lrc => /\[00:\d\d:\d\d.\d+\]/.test(lrc) ? lrc.replace(/(?:\[00:(\d\d:\d\d.\d+\]))/gm, '[$1') : lrc
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置歌曲meta信息
|
* 设置歌曲meta信息
|
||||||
* @param {*} downloadInfo
|
* @param {*} downloadInfo
|
||||||
|
@ -184,7 +187,8 @@ const saveMeta = (downloadInfo, filePath, isEmbedPic, isEmbedLyric) => {
|
||||||
})
|
})
|
||||||
: Promise.resolve(),
|
: Promise.resolve(),
|
||||||
]
|
]
|
||||||
Promise.all(tasks).then(([imgUrl, lyrics]) => {
|
Promise.all(tasks).then(([imgUrl, lyrics = {}]) => {
|
||||||
|
if (lyrics.lyric) lyrics.lyric = fixKgLyric(lyrics.lyric)
|
||||||
setMeta(filePath, {
|
setMeta(filePath, {
|
||||||
title: downloadInfo.musicInfo.name,
|
title: downloadInfo.musicInfo.name,
|
||||||
artist: downloadInfo.musicInfo.singer,
|
artist: downloadInfo.musicInfo.singer,
|
||||||
|
@ -205,7 +209,10 @@ const downloadLyric = (downloadInfo, filePath) => {
|
||||||
? Promise.resolve({ lyric: downloadInfo.musicInfo.lrc, tlyric: downloadInfo.musicInfo.tlrc || '' })
|
? Promise.resolve({ lyric: downloadInfo.musicInfo.lrc, tlyric: downloadInfo.musicInfo.tlrc || '' })
|
||||||
: music[downloadInfo.musicInfo.source].getLyric(downloadInfo.musicInfo).promise
|
: music[downloadInfo.musicInfo.source].getLyric(downloadInfo.musicInfo).promise
|
||||||
promise.then(lrcs => {
|
promise.then(lrcs => {
|
||||||
if (lrcs.lyric) saveLrc(filePath.replace(/(mp3|flac|ape|wav)$/, 'lrc'), lrcs.lyric)
|
if (lrcs.lyric) {
|
||||||
|
lrcs.lyric = fixKgLyric(lrcs.lyric)
|
||||||
|
saveLrc(filePath.replace(/(mp3|flac|ape|wav)$/, 'lrc'), lrcs.lyric)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,10 @@ const parseLyric = str => {
|
||||||
let time = parseInt(result[2])
|
let time = parseInt(result[2])
|
||||||
let ms = time % 1000
|
let ms = time % 1000
|
||||||
time /= 1000
|
time /= 1000
|
||||||
let h = parseInt(time / 3600).toString().padStart(2, '0')
|
|
||||||
time %= 3600
|
|
||||||
let m = parseInt(time / 60).toString().padStart(2, '0')
|
let m = parseInt(time / 60).toString().padStart(2, '0')
|
||||||
time %= 60
|
time %= 60
|
||||||
let s = parseInt(time).toString().padStart(2, '0')
|
let s = parseInt(time).toString().padStart(2, '0')
|
||||||
time = `${h}:${m}:${s}.${ms}`
|
time = `${m}:${s}.${ms}`
|
||||||
if (tlyric) tlyric[i] = `[${time}]${tlyric[i++][0]}`
|
if (tlyric) tlyric[i] = `[${time}]${tlyric[i++][0]}`
|
||||||
return str.replace(result[1], time)
|
return str.replace(result[1], time)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue