Compare commits

...

3 Commits

Author SHA1 Message Date
lyswhut
9858170e61 发布0.2.2版本 2019-08-21 22:52:34 +08:00
lyswhut
16711e33e8 更新描述文本 2019-08-21 20:07:40 +08:00
lyswhut
f534e11acb 修复下载过程中出错重试5次都失败后不会自动开始下一个任务的Bug 2019-08-21 13:18:59 +08:00
9 changed files with 55 additions and 26 deletions

View File

@@ -6,6 +6,13 @@ Project versioning adheres to [Semantic Versioning](http://semver.org/).
Commit convention is based on [Conventional Commits](http://conventionalcommits.org).
Change log format is based on [Keep a Changelog](http://keepachangelog.com/).
## [0.2.2](https://github.com/lyswhut/lx-music-desktop/compare/v0.2.1...v0.2.2) - 2019-08-21
### 修复
- 修复下载过程中出错重试5次都失败后不会自动开始下一个任务的Bug
- 修复播放到一半URL过期时不会刷新URL直接播放下一首的问题
## [0.2.1](https://github.com/lyswhut/lx-music-desktop/compare/v0.2.0...v0.2.1) - 2019-08-20
### 优化

View File

@@ -37,15 +37,20 @@
- Electron 6.x
- Vue 2.x
其他说明TODO
软件变化请查看:[更新日志](https://github.com/lyswhut/lx-music-desktop/blob/master/CHANGELOG.md)
软件变化请查看:[更新日志](https://github.com/lyswhut/lx-music-desktop/blob/master/CHANGELOG.md)<br>
软件下载请转到:[发布页面](https://github.com/lyswhut/lx-music-desktop/releases)
感谢 <https://github.com/messoer> 提供的部分音乐API
其他说明TODO
### 使用方法
#### 关于软件更新
软件启动时若发现新版本时会自动从本仓库下载安装包,下载完毕会弹窗提示更新。<br>
若下载未完成时软件被关闭,下次启动软件会再次自动下载。<br>
目前暂未添加跳过更新某个版本的功能。<br>
### 源码使用方法
环境要求Node.js 12.x
```bash
# 开发模式
@@ -63,6 +68,10 @@ npm run pack
<p><a href="https://github.com/lyswhut/lx-music-desktop"><img width="100%" src="https://github.com/lyswhut/lx-music-desktop/blob/master/doc/images/app.png" alt="lx-music UI"></a></p>
### License
### 致谢
Apache License 2.0
感谢 [@messoer](https://github.com/messoer) 提供的部分音乐API
### 许可证
[Apache License 2.0](https://github.com/lyswhut/lx-music-desktop/blob/master/LICENSE)

View File

@@ -1,6 +1,6 @@
{
"name": "lx-music-desktop",
"version": "0.2.1",
"version": "0.2.2",
"description": "一个免费的音乐下载助手",
"main": "./dist/electron/main.js",
"scripts": {

View File

@@ -1,8 +1,4 @@
### 优化
- 新增歌曲URL存储当URL无效时才重新获取以减少接口不稳定的影响
### 修复
- 修复歌曲加载无法加载时自动切换混乱的Bug
- 修复移除列表最后一首歌曲时播放器不停止播放的问题
- 修复下载过程中出错重试5次都失败后不会自动开始下一个任务的Bug
- 修复播放到一半URL过期时不会刷新URL直接播放下一首的问题

View File

@@ -1,7 +1,11 @@
{
"version": "0.2.1",
"desc": "<h3>优化</h3>\n<ul>\n<li>新增歌曲URL存储当URL无效时才重新获取以减少接口不稳定的影响</li>\n</ul>\n<h3>修复</h3>\n<ul>\n<li>修复歌曲加载无法加载时自动切换混乱的Bug</li>\n<li>修复移除列表最后一首歌曲时播放器不停止播放的问题</li>\n</ul>\n",
"version": "0.2.2",
"desc": "<h3>修复</h3>\n<ul>\n<li>修复下载过程中出错重试5次都失败后不会自动开始下一个任务的Bug</li>\n<li>修复播放到一半URL过期时不会刷新URL直接播放下一首的问题</li>\n</ul>\n",
"history": [
{
"version": "0.2.1",
"desc": "<h3>优化</h3>\n<ul>\n<li>新增歌曲URL存储当URL无效时才重新获取以减少接口不稳定的影响</li>\n</ul>\n<h3>修复</h3>\n<ul>\n<li>修复歌曲加载无法加载时自动切换混乱的Bug</li>\n<li>修复移除列表最后一首歌曲时播放器不停止播放的问题</li>\n</ul>\n"
},
{
"version": "0.2.0",
"desc": "<h3>新增</h3>\n<ul>\n<li>新增<strong>百度音乐</strong>排行榜及其音乐直接试听与下载</li>\n<li>新增网易云排行榜音乐直接试听与下载目前仅支持128k音质</li>\n<li>新增酷狗排行榜音乐直接试听与下载目前仅支持128k音质</li>\n</ul>\n<h3>修复</h3>\n<ul>\n<li>修复更新弹窗历史版本描述多余的换行问题</li>\n<li>修复歌曲无法播放的情况下歌词仍会播放的问题</li>\n</ul>\n"

View File

@@ -53,7 +53,7 @@ export default {
},
defaultList: {
handler(n) {
console.log(n)
// console.log(n)
this.electronStore.set('list.defaultList', n)
},
deep: true,
@@ -111,7 +111,7 @@ export default {
},
initPlayList() {
let defaultList = this.electronStore.get('list.defaultList')
console.log(defaultList)
// console.log(defaultList)
if (defaultList) {
// defaultList.list.forEach(m => {
// m.typeUrl = {}

View File

@@ -70,6 +70,7 @@ export default {
line: 0,
},
delayNextTimeout: null,
audioErrorTime: 0,
// retryNum: 0,
}
},
@@ -174,8 +175,9 @@ export default {
// console.log('code', this.audio.error.code)
if (!this.musicInfo.songmid) return
console.log('出错')
if (this.audio.error.code == 4 && this.retryNum < 3) { // 若音频URL无效则尝试刷新3次URL
if (this.audio.error.code !== 1 && this.retryNum < 3) { // 若音频URL无效则尝试刷新3次URL
// console.log(this.retryNum)
this.audioErrorTime = this.audio.currentTime // 记录出错的播放时间
this.retryNum++
this.setUrl(this.list[this.playIndex], true)
return
@@ -203,6 +205,10 @@ export default {
})
this.audio.addEventListener('loadeddata', () => {
this.maxPlayTime = this.audio.duration
if (this.audioErrorTime) {
this.audio.currentTime = this.audioErrorTime
this.audioErrorTime = 0
}
if (!this.targetSong.interval && this.listId != 'download') this.updateMusicInfo({ index: this.playIndex, data: { interval: formatPlayTime2(this.maxPlayTime) } })
this.status = '音乐加载中...'
})
@@ -249,6 +255,7 @@ export default {
this.checkDelayNextTimeout()
let targetSong = this.targetSong = this.list[this.playIndex]
this.retryNum = 0
this.audioErrorTime = 0
if (this.listId == 'download') {
if (!checkPath(targetSong.filePath) || !targetSong.isComplate || /\.ape$/.test(targetSong.filePath)) {
@@ -296,7 +303,7 @@ export default {
}
if (!list.length) return this.setPlayIndex(-1)
let playIndex = this.list === list ? this.playIndex : list.indexOf(this.list[this.playIndex])
console.log(playIndex)
// console.log(playIndex)
let index
switch (this.setting.player.togglePlayMethod) {
case 'listLoop':
@@ -369,12 +376,13 @@ export default {
this.musicInfo.url = targetSong.typeUrl[type]
this.status = '歌曲链接获取中...'
this.getUrl({ musicInfo: targetSong, type, isRefresh }).then(() => {
return this.getUrl({ musicInfo: targetSong, type, isRefresh }).then(() => {
this.audio.src = this.musicInfo.url = targetSong.typeUrl[type]
}).catch(err => {
if (err.message == requestMsg.cancelRequest) return
this.status = err.message
this.addDelayNextTimeout()
return Promise.reject(err)
})
},
setImg(targetSong) {

View File

@@ -138,10 +138,13 @@ const actions = {
console.log('on complate')
},
onError(err) {
console.log(err.code, err.message)
// console.log(err.code, err.message)
commit('onError', downloadInfo)
// console.log(tryNum[downloadInfo.key])
if (++tryNum[downloadInfo.key] > 5) return
if (++tryNum[downloadInfo.key] > 5) {
_this.dispatch('download/startTask')
return
}
let code
if (err.message.includes('Response status was')) {
code = err.message.replace(/Response status was (\d+)$/, '$1')
@@ -170,9 +173,7 @@ const actions = {
console.log(err)
_this.dispatch('download/startTask')
})
return
}
_this.dispatch('download/startTask')
},
// onStateChanged(state) {
// console.log(state)

View File

@@ -86,6 +86,10 @@ div.scroll(:class="$style.setting")
strong @messoer
|
p.small 若有问题可 mail tolyswhut@qq.com 或到 github 提交 issue
p.small
| 若觉得好用的话去GitHub点个
strong star
| 支持作者吧~
p
small By
| 落雪无痕