commit
94e9f01e62
|
@ -1,8 +1,9 @@
|
||||||
name: ✨功能请求
|
name: ✨功能请求
|
||||||
description: 为这个项目提出一个想法,请先查看常见问题及搜索issue列表中有无你要提的问题
|
description: 为这个项目提出一个想法,请先查看常见问题及搜索issue列表中有无你要提的问题
|
||||||
title: "[Feature]: <title>"
|
title: "[Feature]: "
|
||||||
body:
|
body:
|
||||||
- type: checkboxes
|
- type: checkboxes
|
||||||
|
id: check-answer
|
||||||
attributes:
|
attributes:
|
||||||
label: 解决方案检查
|
label: 解决方案检查
|
||||||
description: 请确保你已完成以下所有操作
|
description: 请确保你已完成以下所有操作
|
||||||
|
@ -12,24 +13,28 @@ body:
|
||||||
- label: 我已搜索issue列表(<https://github.com/lyswhut/lx-music-desktop/issues?utf8=✓&q=>),但没有发现类似的问题
|
- label: 我已搜索issue列表(<https://github.com/lyswhut/lx-music-desktop/issues?utf8=✓&q=>),但没有发现类似的问题
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
id: problem-description
|
||||||
attributes:
|
attributes:
|
||||||
label: 问题描述
|
label: 问题描述
|
||||||
description: 请添加清晰简洁的描述,说明你希望通过此功能请求解决的问题
|
description: 请添加清晰简洁的描述,说明你希望通过此功能请求解决的问题
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
id: proposed-solution
|
||||||
attributes:
|
attributes:
|
||||||
label: 描述您想要的解决方案
|
label: 描述你想要的解决方案
|
||||||
description: 简洁明了地描述你要发生的事情
|
description: 简洁明了地描述你要发生的事情
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
id: alternatives-considered
|
||||||
attributes:
|
attributes:
|
||||||
label: 描述您考虑过的替代方案
|
label: 描述你考虑过的替代方案
|
||||||
description: 对你考虑过的所有替代解决方案或功能的简洁明了的描述
|
description: 对你考虑过的所有替代解决方案或功能的简洁明了的描述
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
id: additional-information
|
||||||
attributes:
|
attributes:
|
||||||
label: 附加信息
|
label: 附加信息
|
||||||
description: 如果你的问题需要进一步解释,或者想要表达其他内容,请在此处添加更多信息。(直接把图片、视频拖到编辑框即可添加图片或视频)
|
description: 如果你的问题需要进一步解释,或者想要表达其他内容,请在此处添加更多信息。(直接把图片、视频拖到编辑框即可添加图片或视频)
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
name: 🐞报告Bug
|
name: 🐞报告Bug
|
||||||
description: 报告bug,请先查看常见问题及搜索issue列表中有无你要提的问题
|
description: 报告bug,请先查看常见问题及搜索issue列表中有无你要提的问题
|
||||||
title: "[Bug]: <title>"
|
title: "[Bug]: "
|
||||||
body:
|
body:
|
||||||
- type: checkboxes
|
- type: checkboxes
|
||||||
|
id: check-answer
|
||||||
attributes:
|
attributes:
|
||||||
label: 解决方案检查
|
label: 解决方案检查
|
||||||
description: 请确保你已完成以下所有操作
|
description: 请确保你已完成以下所有操作
|
||||||
|
@ -12,18 +13,21 @@ body:
|
||||||
- label: 我已搜索issue列表(<https://github.com/lyswhut/lx-music-desktop/issues?utf8=✓&q=>),并没有发现类似的问题
|
- label: 我已搜索issue列表(<https://github.com/lyswhut/lx-music-desktop/issues?utf8=✓&q=>),并没有发现类似的问题
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
id: expected-behavior
|
||||||
attributes:
|
attributes:
|
||||||
label: 预期行为
|
label: 预期行为
|
||||||
description: 对期望发生的事情的清晰简明描述
|
description: 对期望发生的事情的清晰简明描述
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
id: actual-behavior
|
||||||
attributes:
|
attributes:
|
||||||
label: 实际行为
|
label: 实际行为
|
||||||
description: 对实际发生的事情的清晰简明描述
|
description: 对实际发生的事情的清晰简明描述
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: input
|
- type: input
|
||||||
|
id: version
|
||||||
attributes:
|
attributes:
|
||||||
label: Lx Music 版本
|
label: Lx Music 版本
|
||||||
description: 你使用什么版本的LX Music?
|
description: 你使用什么版本的LX Music?
|
||||||
|
@ -31,11 +35,13 @@ body:
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: input
|
- type: input
|
||||||
|
id: last-known-working-version
|
||||||
attributes:
|
attributes:
|
||||||
label: 最后正常的版本
|
label: 最后正常的版本
|
||||||
description: 如果有,请在此处填写最后正常的版本是多少?
|
description: 如果有,请在此处填写最后正常的版本是多少?
|
||||||
placeholder: 1.15.0
|
placeholder: 1.15.0
|
||||||
- type: input
|
- type: input
|
||||||
|
id: operating-system-version
|
||||||
attributes:
|
attributes:
|
||||||
label: 操作系统版本
|
label: 操作系统版本
|
||||||
description: 您使用的是什么操作系统版本?在 Windows 上,单击开始按钮 > 设置 > 系统 > 关于;在 macOS 上,单击 Apple 菜单 > 关于本机;在 Linux 上,使用 lsb_release 或 uname -a
|
description: 您使用的是什么操作系统版本?在 Windows 上,单击开始按钮 > 设置 > 系统 > 关于;在 macOS 上,单击 Apple 菜单 > 关于本机;在 Linux 上,使用 lsb_release 或 uname -a
|
||||||
|
@ -43,6 +49,7 @@ body:
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
id: additional-information
|
||||||
attributes:
|
attributes:
|
||||||
label: 附加信息
|
label: 附加信息
|
||||||
description: 如果你的问题需要进一步解释,或者你所遇到的问题不容易重现,请在此处添加更多信息。(直接把图片、视频拖到编辑框即可添加图片或视频)
|
description: 如果你的问题需要进一步解释,或者你所遇到的问题不容易重现,请在此处添加更多信息。(直接把图片、视频拖到编辑框即可添加图片或视频)
|
||||||
|
|
|
@ -4,6 +4,8 @@ module.exports = {
|
||||||
'vue-loader',
|
'vue-loader',
|
||||||
'webpack-dev-server',
|
'webpack-dev-server',
|
||||||
'eslint',
|
'eslint',
|
||||||
|
'electron',
|
||||||
|
'electron-builder'
|
||||||
// 'eslint-config-standard'
|
// 'eslint-config-standard'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,15 @@ Project versioning adheres to [Semantic Versioning](http://semver.org/).
|
||||||
Commit convention is based on [Conventional Commits](http://conventionalcommits.org).
|
Commit convention is based on [Conventional Commits](http://conventionalcommits.org).
|
||||||
Change log format is based on [Keep a Changelog](http://keepachangelog.com/).
|
Change log format is based on [Keep a Changelog](http://keepachangelog.com/).
|
||||||
|
|
||||||
|
## [1.15.3](https://github.com/lyswhut/lx-music-desktop/compare/v1.15.2...v1.15.3) - 2021-11-21
|
||||||
|
|
||||||
|
### 修复
|
||||||
|
|
||||||
|
- 修复设置-控制按钮位置选项与下载歌词编码格式选项命名冲突导致选项显示异常的问题
|
||||||
|
- 修复播放下载列表时存在失效的歌曲会导致切歌不准确的问题
|
||||||
|
- 修复潜在的音乐加载超时不会切歌的问题
|
||||||
|
- 修复因kw源歌词接口停用导致该源歌词获取失败的问题
|
||||||
|
|
||||||
## [1.15.2](https://github.com/lyswhut/lx-music-desktop/compare/v1.15.3...v1.15.2) - 2021-11-09
|
## [1.15.2](https://github.com/lyswhut/lx-music-desktop/compare/v1.15.3...v1.15.2) - 2021-11-09
|
||||||
|
|
||||||
### 其他
|
### 其他
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "lx-music-desktop",
|
"name": "lx-music-desktop",
|
||||||
"version": "1.15.2",
|
"version": "1.15.3",
|
||||||
"description": "一个免费的音乐查找助手",
|
"description": "一个免费的音乐查找助手",
|
||||||
"main": "./dist/electron/main.js",
|
"main": "./dist/electron/main.js",
|
||||||
"productName": "lx-music-desktop",
|
"productName": "lx-music-desktop",
|
||||||
|
@ -171,36 +171,36 @@
|
||||||
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
||||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||||
"@babel/plugin-transform-modules-umd": "^7.16.0",
|
"@babel/plugin-transform-modules-umd": "^7.16.0",
|
||||||
"@babel/plugin-transform-runtime": "^7.16.0",
|
"@babel/plugin-transform-runtime": "^7.16.4",
|
||||||
"@babel/polyfill": "^7.12.1",
|
"@babel/polyfill": "^7.12.1",
|
||||||
"@babel/preset-env": "^7.16.0",
|
"@babel/preset-env": "^7.16.4",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"babel-loader": "^8.2.3",
|
"babel-loader": "^8.2.3",
|
||||||
"babel-preset-minify": "^0.5.1",
|
"babel-preset-minify": "^0.5.1",
|
||||||
"browserslist": "^4.17.6",
|
"browserslist": "^4.18.1",
|
||||||
"cfonts": "^2.10.0",
|
"cfonts": "^2.10.0",
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^4.1.2",
|
||||||
"changelog-parser": "^2.8.0",
|
"changelog-parser": "^2.8.0",
|
||||||
"copy-webpack-plugin": "^9.0.1",
|
"copy-webpack-plugin": "^10.0.0",
|
||||||
"core-js": "^3.19.1",
|
"core-js": "^3.19.1",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"css-loader": "^6.5.1",
|
"css-loader": "^6.5.1",
|
||||||
"css-minimizer-webpack-plugin": "^3.1.2",
|
"css-minimizer-webpack-plugin": "^3.1.4",
|
||||||
"del": "^6.0.0",
|
"del": "^6.0.0",
|
||||||
"electron": "^13.4.0",
|
"electron": "^13.4.0",
|
||||||
"electron-builder": "^22.11.7",
|
"electron-builder": "^22.11.7",
|
||||||
"electron-debug": "^3.2.0",
|
"electron-debug": "^3.2.0",
|
||||||
"electron-devtools-installer": "^3.2.0",
|
"electron-devtools-installer": "^3.2.0",
|
||||||
"electron-to-chromium": "^1.3.891",
|
"electron-to-chromium": "^1.3.904",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-formatter-friendly": "^7.0.0",
|
"eslint-formatter-friendly": "^7.0.0",
|
||||||
"eslint-plugin-html": "^6.2.0",
|
"eslint-plugin-html": "^6.2.0",
|
||||||
"eslint-plugin-import": "^2.25.2",
|
"eslint-plugin-import": "^2.25.3",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.1",
|
"eslint-plugin-promise": "^5.1.1",
|
||||||
"eslint-plugin-standard": "^4.1.0",
|
"eslint-plugin-standard": "^4.1.0",
|
||||||
"eslint-webpack-plugin": "^3.1.0",
|
"eslint-webpack-plugin": "^3.1.1",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
"friendly-errors-webpack-plugin": "^1.7.0",
|
"friendly-errors-webpack-plugin": "^1.7.0",
|
||||||
"html-webpack-plugin": "^5.5.0",
|
"html-webpack-plugin": "^5.5.0",
|
||||||
|
@ -208,7 +208,7 @@
|
||||||
"less-loader": "^10.2.0",
|
"less-loader": "^10.2.0",
|
||||||
"less-plugin-clean-css": "^1.5.1",
|
"less-plugin-clean-css": "^1.5.1",
|
||||||
"markdown-it": "^12.2.0",
|
"markdown-it": "^12.2.0",
|
||||||
"mini-css-extract-plugin": "^2.4.4",
|
"mini-css-extract-plugin": "^2.4.5",
|
||||||
"node-loader": "^2.0.0",
|
"node-loader": "^2.0.0",
|
||||||
"postcss": "^8.3.11",
|
"postcss": "^8.3.11",
|
||||||
"postcss-loader": "^6.2.0",
|
"postcss-loader": "^6.2.0",
|
||||||
|
@ -223,7 +223,7 @@
|
||||||
"url-loader": "^4.1.1",
|
"url-loader": "^4.1.1",
|
||||||
"vue-loader": "^15.9.8",
|
"vue-loader": "^15.9.8",
|
||||||
"vue-template-compiler": "^2.6.14",
|
"vue-template-compiler": "^2.6.14",
|
||||||
"webpack": "^5.62.1",
|
"webpack": "^5.64.2",
|
||||||
"webpack-cli": "^4.9.1",
|
"webpack-cli": "^4.9.1",
|
||||||
"webpack-dev-server": "^3.11.2",
|
"webpack-dev-server": "^3.11.2",
|
||||||
"webpack-hot-middleware": "^2.25.1",
|
"webpack-hot-middleware": "^2.25.1",
|
||||||
|
@ -234,8 +234,8 @@
|
||||||
"crypto-js": "^4.1.1",
|
"crypto-js": "^4.1.1",
|
||||||
"electron-log": "^4.4.1",
|
"electron-log": "^4.4.1",
|
||||||
"electron-store": "^8.0.1",
|
"electron-store": "^8.0.1",
|
||||||
"electron-updater": "^4.3.9",
|
"electron-updater": "^4.6.1",
|
||||||
"font-list": "git+https://github.com/lyswhut/node-font-list.git#2ed3b4ee42e8a43373e8a30d87760c840725843e",
|
"font-list": "git+https://github.com/lyswhut/node-font-list.git#4edbb1933b49a9bac1eedd63a31da16b487fe57d",
|
||||||
"http-terminator": "^3.0.3",
|
"http-terminator": "^3.0.3",
|
||||||
"iconv-lite": "^0.6.3",
|
"iconv-lite": "^0.6.3",
|
||||||
"image-size": "^1.0.0",
|
"image-size": "^1.0.0",
|
||||||
|
@ -244,7 +244,7 @@
|
||||||
"needle": "^3.0.0",
|
"needle": "^3.0.0",
|
||||||
"node-id3": "^0.2.3",
|
"node-id3": "^0.2.3",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
"socket.io": "^4.3.2",
|
"socket.io": "^4.4.0",
|
||||||
"utf-8-validate": "^5.0.7",
|
"utf-8-validate": "^5.0.7",
|
||||||
"vue": "^2.6.14",
|
"vue": "^2.6.14",
|
||||||
"vue-i18n": "^8.26.7",
|
"vue-i18n": "^8.26.7",
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
### 其他
|
### 修复
|
||||||
|
|
||||||
- 降级electron到v13.4.0(这修复了windows 7下播放歌曲时软件会崩溃的问题)
|
- 修复设置-控制按钮位置选项与下载歌词编码格式选项命名冲突导致选项显示异常的问题
|
||||||
|
- 修复播放下载列表时存在失效的歌曲会导致切歌不准确的问题
|
||||||
|
- 修复潜在的音乐加载超时不会切歌的问题
|
||||||
|
- 修复因kw源歌词接口停用导致该源歌词获取失败的问题
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -35,7 +35,7 @@ const names = {
|
||||||
|
|
||||||
lang_s2t: 'lang_s2t',
|
lang_s2t: 'lang_s2t',
|
||||||
|
|
||||||
handle_kw_decode_lyric: 'handle_kw_decode_lyric',
|
// handle_kw_decode_lyric: 'handle_kw_decode_lyric',
|
||||||
get_lyric_info: 'get_lyric_info',
|
get_lyric_info: 'get_lyric_info',
|
||||||
set_lyric_info: 'set_lyric_info',
|
set_lyric_info: 'set_lyric_info',
|
||||||
set_config: 'set_config',
|
set_config: 'set_config',
|
||||||
|
|
|
@ -21,7 +21,7 @@ require('./lyric')
|
||||||
require('./musicUrl')
|
require('./musicUrl')
|
||||||
require('./systemFonts')
|
require('./systemFonts')
|
||||||
|
|
||||||
require('./kw_decodeLyric')
|
// require('./kw_decodeLyric')
|
||||||
|
|
||||||
require('./userApi')
|
require('./userApi')
|
||||||
require('./sync')
|
require('./sync')
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -370,6 +370,7 @@ export default {
|
||||||
|
|
||||||
audio.addEventListener('playing', () => {
|
audio.addEventListener('playing', () => {
|
||||||
console.log('开始播放')
|
console.log('开始播放')
|
||||||
|
this.clearBufferTimeout()
|
||||||
this.statusText = this.$t('core.player.playing')
|
this.statusText = this.$t('core.player.playing')
|
||||||
this.status = ''
|
this.status = ''
|
||||||
this.startPlay()
|
this.startPlay()
|
||||||
|
@ -432,7 +433,6 @@ export default {
|
||||||
this.mediaBuffer.playTime = 0
|
this.mediaBuffer.playTime = 0
|
||||||
audio.currentTime = playTime
|
audio.currentTime = playTime
|
||||||
}
|
}
|
||||||
this.clearBufferTimeout()
|
|
||||||
this.updatePositionState()
|
this.updatePositionState()
|
||||||
|
|
||||||
// if (this.musicInfo.lrc) window.lrc.play(audio.currentTime * 1000)
|
// if (this.musicInfo.lrc) window.lrc.play(audio.currentTime * 1000)
|
||||||
|
|
|
@ -70,7 +70,7 @@ div(:class="$style.songList")
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import { scrollTo, clipboardWriteText, assertApiSupport } from '../../utils'
|
import { clipboardWriteText, assertApiSupport } from '../../utils'
|
||||||
import musicSdk from '../../utils/music'
|
import musicSdk from '../../utils/music'
|
||||||
import { windowSizeList } from '@common/config'
|
import { windowSizeList } from '@common/config'
|
||||||
export default {
|
export default {
|
||||||
|
@ -189,7 +189,7 @@ export default {
|
||||||
list(n) {
|
list(n) {
|
||||||
this.removeAllSelect()
|
this.removeAllSelect()
|
||||||
if (!this.list.length) return
|
if (!this.list.length) return
|
||||||
this.$nextTick(() => scrollTo(this.$refs.dom_scrollContent, 0))
|
this.$nextTick(() => this.$refs.list.scrollTo(0))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -192,7 +192,7 @@ const getters = {
|
||||||
// listPlayIndex,
|
// listPlayIndex,
|
||||||
// isPlayList,
|
// isPlayList,
|
||||||
// isTempPlay,
|
// isTempPlay,
|
||||||
// // musicInfo: state.playMusicInfo.musicInfo,
|
// musicInfo: state.playMusicInfo.musicInfo,
|
||||||
// })
|
// })
|
||||||
|
|
||||||
// console.log(state.playMusicInfo)
|
// console.log(state.playMusicInfo)
|
||||||
|
@ -305,7 +305,7 @@ const actions = {
|
||||||
})
|
})
|
||||||
if (!filteredList.length) return commit('setPlayMusicInfo', null)
|
if (!filteredList.length) return commit('setPlayMusicInfo', null)
|
||||||
|
|
||||||
let listPlayIndex = playInfo.listPlayIndex
|
let listPlayIndex = filteredList.indexOf(state.listInfo.list[playInfo.listPlayIndex])
|
||||||
const currentListLength = state.listInfo.list.length - 1
|
const currentListLength = state.listInfo.list.length - 1
|
||||||
if (listPlayIndex == -1 && currentListLength) {
|
if (listPlayIndex == -1 && currentListLength) {
|
||||||
listPlayIndex = prevListPlayIndex >= currentListLength ? 0 : prevListPlayIndex + 1
|
listPlayIndex = prevListPlayIndex >= currentListLength ? 0 : prevListPlayIndex + 1
|
||||||
|
@ -380,7 +380,7 @@ const actions = {
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!filteredList.length) return commit('setPlayMusicInfo', null)
|
if (!filteredList.length) return commit('setPlayMusicInfo', null)
|
||||||
let listPlayIndex = playInfo.listPlayIndex
|
let listPlayIndex = filteredList.indexOf(state.listInfo.list[playInfo.listPlayIndex])
|
||||||
const currentListLength = state.listInfo.list.length - 1
|
const currentListLength = state.listInfo.list.length - 1
|
||||||
if (listPlayIndex == -1 && currentListLength) {
|
if (listPlayIndex == -1 && currentListLength) {
|
||||||
listPlayIndex = prevListPlayIndex > currentListLength ? currentListLength : prevListPlayIndex - 1
|
listPlayIndex = prevListPlayIndex > currentListLength ? currentListLength : prevListPlayIndex - 1
|
||||||
|
|
|
@ -1,7 +1,63 @@
|
||||||
import { httpFetch } from '../../request'
|
import { httpFetch } from '../../request'
|
||||||
import { decodeLyric } from './util'
|
import { decodeName } from '../../index'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
formatTime(time) {
|
||||||
|
let m = parseInt(time / 60)
|
||||||
|
let s = (time % 60).toFixed(2)
|
||||||
|
return (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s)
|
||||||
|
},
|
||||||
|
sortLrcArr(arr) {
|
||||||
|
const lrcSet = new Set()
|
||||||
|
let lrc = []
|
||||||
|
let lrcT = []
|
||||||
|
|
||||||
|
for (const item of arr) {
|
||||||
|
if (lrcSet.has(item.time)) {
|
||||||
|
lrc.push(item)
|
||||||
|
} else {
|
||||||
|
lrcT.push(item)
|
||||||
|
lrcSet.add(item.time)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (lrc.length) {
|
||||||
|
lrc.unshift(lrcT.shift())
|
||||||
|
} else {
|
||||||
|
lrc = lrcT
|
||||||
|
lrcT = []
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
lrc,
|
||||||
|
lrcT,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
transformLrc(songinfo, lrclist) {
|
||||||
|
return `[ti:${songinfo.songName}]\n[ar:${songinfo.artist}]\n[al:${songinfo.album}]\n[by:]\n[offset:0]\n${lrclist ? lrclist.map(l => `[${this.formatTime(l.time)}]${l.lineLyric}\n`).join('') : '暂无歌词'}`
|
||||||
|
},
|
||||||
|
getLyric(songId) {
|
||||||
|
const requestObj = httpFetch(`http://m.kuwo.cn/newh5/singles/songinfoandlrc?musicId=${songId}`)
|
||||||
|
requestObj.promise = requestObj.promise.then(({ body }) => {
|
||||||
|
// console.log(body)
|
||||||
|
if (!body.data?.lrclist?.length) return Promise.reject(new Error('Get lyric failed'))
|
||||||
|
const { lrc, lrcT } = this.sortLrcArr(body.data.lrclist)
|
||||||
|
// console.log(body.data.lrclist)
|
||||||
|
// console.log(lrc, lrcT)
|
||||||
|
// console.log({
|
||||||
|
// lyric: decodeName(this.transformLrc(body.data.songinfo, lrc)),
|
||||||
|
// tlyric: decodeName(this.transformLrc(body.data.songinfo, lrcT)),
|
||||||
|
// })
|
||||||
|
return {
|
||||||
|
lyric: decodeName(this.transformLrc(body.data.songinfo, lrc)),
|
||||||
|
tlyric: lrcT.length ? decodeName(this.transformLrc(body.data.songinfo, lrcT)) : '',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return requestObj
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* export default {
|
||||||
lrcInfoRxp: /<lyric>(.+?)<\/lyric>[\s\S]+<lyric_zz>(.+?)<\/lyric_zz>/,
|
lrcInfoRxp: /<lyric>(.+?)<\/lyric>[\s\S]+<lyric_zz>(.+?)<\/lyric_zz>/,
|
||||||
parseLyricInfo(str) {
|
parseLyricInfo(str) {
|
||||||
let result = str.match(this.lrcInfoRxp)
|
let result = str.match(this.lrcInfoRxp)
|
||||||
|
@ -10,6 +66,7 @@ export default {
|
||||||
getLyric(songId, isGetLyricx = false) {
|
getLyric(songId, isGetLyricx = false) {
|
||||||
const requestObj = httpFetch(`http://player.kuwo.cn/webmusic/st/getNewMuiseByRid?rid=MUSIC_${songId}`)
|
const requestObj = httpFetch(`http://player.kuwo.cn/webmusic/st/getNewMuiseByRid?rid=MUSIC_${songId}`)
|
||||||
requestObj.promise = requestObj.promise.then(({ statusCode, body }) => {
|
requestObj.promise = requestObj.promise.then(({ statusCode, body }) => {
|
||||||
|
console.log(body)
|
||||||
if (statusCode != 200) return Promise.reject(new Error(JSON.stringify(body)))
|
if (statusCode != 200) return Promise.reject(new Error(JSON.stringify(body)))
|
||||||
let info = this.parseLyricInfo(body)
|
let info = this.parseLyricInfo(body)
|
||||||
if (!info) return Promise.reject(new Error(JSON.stringify(body)))
|
if (!info) return Promise.reject(new Error(JSON.stringify(body)))
|
||||||
|
@ -27,3 +84,4 @@ export default {
|
||||||
return requestObj
|
return requestObj
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { httpGet, httpFetch } from '../../request'
|
import { httpGet, httpFetch } from '../../request'
|
||||||
import { rendererInvoke, NAMES } from '../../../../common/ipc'
|
// import { rendererInvoke, NAMES } from '../../../../common/ipc'
|
||||||
|
|
||||||
const kw_token = {
|
const kw_token = {
|
||||||
token: null,
|
token: null,
|
||||||
|
@ -54,7 +54,7 @@ export const getToken = (retryNum = 0) => new Promise((resolve, reject) => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
export const decodeLyric = base64Data => rendererInvoke(NAMES.mainWindow.handle_kw_decode_lyric, base64Data)
|
// export const decodeLyric = base64Data => rendererInvoke(NAMES.mainWindow.handle_kw_decode_lyric, base64Data)
|
||||||
|
|
||||||
export const tokenRequest = async(url, options = {}) => {
|
export const tokenRequest = async(url, options = {}) => {
|
||||||
let token = kw_token.token
|
let token = kw_token.token
|
||||||
|
|
|
@ -157,7 +157,7 @@ div(:class="$style.main")
|
||||||
h3#download_lyric {{$t('view.setting.download_lyric_format')}}
|
h3#download_lyric {{$t('view.setting.download_lyric_format')}}
|
||||||
div
|
div
|
||||||
material-checkbox(v-for="item in lrcFormatList" :key="item.id" :class="$style.gapLeft" :id="`setting_download_lrcFormat_${item.id}`"
|
material-checkbox(v-for="item in lrcFormatList" :key="item.id" :class="$style.gapLeft" :id="`setting_download_lrcFormat_${item.id}`"
|
||||||
name="setting_basic_control_btn_position" need v-model="current_setting.download.lrcFormat" :value="item.id" :label="item.name")
|
name="setting_download_lrcFormat" need v-model="current_setting.download.lrcFormat" :value="item.id" :label="item.name")
|
||||||
|
|
||||||
dt#sync {{$t('view.setting.sync')}}
|
dt#sync {{$t('view.setting.sync')}}
|
||||||
dd
|
dd
|
||||||
|
|
Loading…
Reference in New Issue