diff --git a/.gitignore b/.gitignore
index 2c55eb6c..41dd8bdf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -69,3 +69,5 @@ dist
publish/assets
publish/utils/githubToken.js
+
+src/**/*-internal.js
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6dfcd1b2..b4f4b193 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,16 @@ 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.3.4](https://github.com/lyswhut/lx-music-desktop/compare/v0.3.3...v0.3.4) - 2019-08-29
+
+### 优化
+
+- 减少接口不稳定带来的影响,适当增加请求等待时间
+
+### 修复
+
+- 修复播放过程中URL过期不会刷新URL的问题
+
## [0.3.3](https://github.com/lyswhut/lx-music-desktop/compare/v0.3.2...v0.3.3) - 2019-08-29
### 修复
diff --git a/package.json b/package.json
index 7ed07b49..61a58596 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "lx-music-desktop",
- "version": "0.3.3",
+ "version": "0.3.4",
"description": "一个免费的音乐下载助手",
"main": "./dist/electron/main.js",
"productName": "lx-music-desktop",
diff --git a/publish/changeLog.md b/publish/changeLog.md
index eb2dc4d3..74853617 100644
--- a/publish/changeLog.md
+++ b/publish/changeLog.md
@@ -1,7 +1,7 @@
+### 优化
+
+- 减少接口不稳定带来的影响,适当增加请求等待时间
+
### 修复
-- **messoer**的接口已经关闭,暂时切换到临时接口使用,部分功能受限。。。
-- 修复设置界面更新出错时仍然显示更新下载中的问题
-- 修复手动定位播放进度条时存在偏差的问题
-- 屏蔽播放器中没有歌曲时对进度条的点击
-
+- 修复播放过程中URL过期不会刷新URL的问题
diff --git a/publish/version.json b/publish/version.json
index 32ff4c97..e9986d98 100644
--- a/publish/version.json
+++ b/publish/version.json
@@ -1,7 +1,11 @@
{
- "version": "0.3.3",
- "desc": "
修复
\n\n- messoer的接口已经关闭,暂时切换到临时接口使用,部分功能受限。。。
\n- 修复设置界面更新出错时仍然显示更新下载中的问题
\n- 修复手动定位播放进度条时存在偏差的问题
\n- 屏蔽播放器中没有歌曲时对进度条的点击
\n
\n",
+ "version": "0.3.4",
+ "desc": "优化
\n\n- 减少接口不稳定带来的影响,适当增加请求等待时间
\n
\n修复
\n\n- 修复播放过程中URL过期不会刷新URL的问题
\n
\n",
"history": [
+ {
+ "version": "0.3.3",
+ "desc": "修复
\n\n- messoer的接口已经关闭,暂时切换到临时接口使用,部分功能受限。。。
\n- 修复设置界面更新出错时仍然显示更新下载中的问题
\n- 修复手动定位播放进度条时存在偏差的问题
\n- 屏蔽播放器中没有歌曲时对进度条的点击
\n
\n"
+ },
{
"version": "0.3.2",
"desc": "新增
\n\n"
diff --git a/src/renderer/components/core/Player.vue b/src/renderer/components/core/Player.vue
index 19387833..447297b4 100644
--- a/src/renderer/components/core/Player.vue
+++ b/src/renderer/components/core/Player.vue
@@ -194,15 +194,16 @@ export default {
// console.log('code', this.audio.error.code)
if (!this.musicInfo.songmid) return
console.log('出错')
+ this.stopPlay()
+ this.sendProgressEvent(this.progress, 'error')
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)
+ this.status = 'URL过期,正在刷新URL...'
return
}
- this.stopPlay()
- this.sendProgressEvent(this.progress, 'error')
// let urls = this.player_info.targetSong.urls
// if (urls && urls.some((url, index) => {
diff --git a/src/renderer/utils/music/kg/api-internal.js b/src/renderer/utils/music/kg/api-internal.js
index 2fe074c7..fbdda9c9 100644
--- a/src/renderer/utils/music/kg/api-internal.js
+++ b/src/renderer/utils/music/kg/api-internal.js
@@ -1,6 +1,6 @@
import { httpFatch } from '../../request'
import { requestMsg } from '../../message'
-import { headers, timeout } from '../messoer'
+import { headers, timeout } from '../options'
const api_messoer = {
getMusicUrl(songInfo, type) {
diff --git a/src/renderer/utils/music/kw/api-internal.js b/src/renderer/utils/music/kw/api-internal.js
index 6b22eb59..1964ee72 100644
--- a/src/renderer/utils/music/kw/api-internal.js
+++ b/src/renderer/utils/music/kw/api-internal.js
@@ -1,6 +1,6 @@
import { httpFatch } from '../../request'
import { requestMsg } from '../../message'
-import { headers, timeout } from '../messoer'
+import { headers, timeout } from '../options'
const api_messoer = {
getMusicUrl(songInfo, type) {
diff --git a/src/renderer/utils/music/kw/api-temp.js b/src/renderer/utils/music/kw/api-temp.js
index 14ac6d9a..d29e3670 100644
--- a/src/renderer/utils/music/kw/api-temp.js
+++ b/src/renderer/utils/music/kw/api-temp.js
@@ -1,24 +1,18 @@
import { httpFatch } from '../../request'
+import { headers, timeout } from '../options'
const api_temp = {
getMusicUrl(songInfo, type) {
const requestObj = httpFatch(`http://45.32.53.128:3002/m/kw/u/${songInfo.songmid}/${type}`, {
method: 'get',
+ headers,
+ timeout,
})
requestObj.promise = requestObj.promise.then(({ body }) => {
return body.code === 0 ? Promise.resolve({ type, url: body.data }) : Promise.reject(new Error(body.msg))
})
return requestObj
},
- getPic(songInfo) {
- const requestObj = httpFatch(`http://45.32.53.128:3002/m/kw/i/${songInfo.songmid}`, {
- method: 'get',
- })
- requestObj.promise = requestObj.promise.then(({ body }) => {
- return body.code === 0 ? Promise.resolve(body.data) : Promise.reject(new Error(body.msg))
- })
- return requestObj
- },
}
export default api_temp
diff --git a/src/renderer/utils/music/kw/index.js b/src/renderer/utils/music/kw/index.js
index 9176328d..81989495 100644
--- a/src/renderer/utils/music/kw/index.js
+++ b/src/renderer/utils/music/kw/index.js
@@ -4,6 +4,7 @@ import musicSearch from './musicSearch'
import { formatSinger } from './util'
import leaderboard from './leaderboard'
import lyric from './lyric'
+import pic from './pic'
import api_source from '../api-source'
const kw = {
@@ -91,7 +92,7 @@ const kw = {
},
getPic(songInfo) {
- return api_source('kw').getPic(songInfo)
+ return pic.getPic(songInfo)
},
}
diff --git a/src/renderer/utils/music/kw/pic.js b/src/renderer/utils/music/kw/pic.js
new file mode 100644
index 00000000..08b2c241
--- /dev/null
+++ b/src/renderer/utils/music/kw/pic.js
@@ -0,0 +1,9 @@
+import { httpFatch } from '../../request'
+
+export default {
+ getPic({ songmid }) {
+ const requestObj = httpFatch(`http://artistpicserver.kuwo.cn/pic.web?corp=kuwo&type=rid_pic&pictype=500&size=500&rid=${songmid}`)
+ requestObj.promise = requestObj.promise.then(({ body }) => body)
+ return requestObj
+ },
+}
diff --git a/src/renderer/utils/music/messoer.js b/src/renderer/utils/music/options.js
similarity index 79%
rename from src/renderer/utils/music/messoer.js
rename to src/renderer/utils/music/options.js
index 936b2964..c6ce350c 100644
--- a/src/renderer/utils/music/messoer.js
+++ b/src/renderer/utils/music/options.js
@@ -6,4 +6,4 @@ export const headers = {
}
-export const timeout = 10000
+export const timeout = 15000
diff --git a/src/renderer/utils/music/tx/api-internal.js b/src/renderer/utils/music/tx/api-internal.js
index 06c7536f..dd984fd8 100644
--- a/src/renderer/utils/music/tx/api-internal.js
+++ b/src/renderer/utils/music/tx/api-internal.js
@@ -1,6 +1,6 @@
import { httpFatch } from '../../request'
import { requestMsg } from '../../message'
-import { headers, timeout } from '../messoer'
+import { headers, timeout } from '../options'
const api_messoer = {
getMusicUrl(songInfo, type) {
diff --git a/src/renderer/utils/music/wy/api-internal.js b/src/renderer/utils/music/wy/api-internal.js
index 272cc26d..d836e810 100644
--- a/src/renderer/utils/music/wy/api-internal.js
+++ b/src/renderer/utils/music/wy/api-internal.js
@@ -1,6 +1,6 @@
import { httpFatch } from '../../request'
import { requestMsg } from '../../message'
-import { headers, timeout } from '../messoer'
+import { headers, timeout } from '../options'
const api_messoer = {
getMusicUrl(songInfo, type) {
diff --git a/src/renderer/utils/request.js b/src/renderer/utils/request.js
index ec34f11a..11093b3d 100644
--- a/src/renderer/utils/request.js
+++ b/src/renderer/utils/request.js
@@ -2,7 +2,7 @@ import request from 'request'
// import progress from 'request-progress'
import { debugRequest } from './env'
import { requestMsg } from './message'
-import { bHh } from './music/messoer'
+import { bHh } from './music/options'
// import fs from 'fs'
const headers = {
diff --git a/src/renderer/views/Setting.vue b/src/renderer/views/Setting.vue
index ff078eef..cb95dca1 100644
--- a/src/renderer/views/Setting.vue
+++ b/src/renderer/views/Setting.vue
@@ -175,7 +175,7 @@ export default {
// },
{
id: 'temp',
- label: '临时接口(软件的某些功能将不可用,但可下载无损等音质)',
+ label: '临时接口(软件的某些功能不可用,该接口访问速度较慢,请耐心等待)',
disabled: false,
},
],