diff --git a/publish/changeLog.md b/publish/changeLog.md
index 14019c0b..00131e4d 100644
--- a/publish/changeLog.md
+++ b/publish/changeLog.md
@@ -1,8 +1,3 @@
-#### 优化
+### 优化
-- 大幅减少程序**播放时**对CPU与GPU的使用,经测试CPU使用减少60%以上,GPU使用减少90%以上,这应该能解决MAC系统上的温度上涨的问题
-
-#### 修复
-
-- 修复酷我源**搜索提示**、**排行榜**无法获取的问题
-- 修复咪咕源无法播放的问题
+- 优化更新弹窗机制及其内容描述
diff --git a/src/main/utils/autoUpdate.js b/src/main/utils/autoUpdate.js
index 4aa145a9..d496103d 100644
--- a/src/main/utils/autoUpdate.js
+++ b/src/main/utils/autoUpdate.js
@@ -92,14 +92,14 @@ module.exports = isFirstCheckedUpdate => {
})
autoUpdater.on('error', err => {
sendStatusToWindow('Error in auto-updater.')
- handleSendEvent({ type: 'update-error', info: err })
+ handleSendEvent({ type: 'update-error', info: err.message })
})
autoUpdater.on('download-progress', progressObj => {
let log_message = 'Download speed: ' + progressObj.bytesPerSecond
log_message = log_message + ' - Downloaded ' + progressObj.percent + '%'
log_message = log_message + ' (' + progressObj.transferred + '/' + progressObj.total + ')'
sendStatusToWindow(log_message)
- handleSendEvent({ type: 'download-progress', info: progressObj })
+ handleSendEvent({ type: 'update-progress', info: progressObj })
})
autoUpdater.on('update-downloaded', info => {
sendStatusToWindow('Update downloaded.')
diff --git a/src/renderer/App.vue b/src/renderer/App.vue
index 4e3a72fa..1229b1f2 100644
--- a/src/renderer/App.vue
+++ b/src/renderer/App.vue
@@ -108,33 +108,39 @@ export default {
}
ipcRenderer.on('update-available', (e, info) => {
// this.showUpdateModal(true)
- console.log(info)
- this.setNewVersion({
+ // console.log(info)
+ this.getVersionInfo().catch(() => ({
version: info.version,
+ desc: info.releaseNotes,
+ })).then(body => {
+ // console.log(body)
+ this.setNewVersion(body)
+ this.$nextTick(() => {
+ this.setVersionModalVisible({ isShow: true })
+ })
})
})
- ipcRenderer.on('update-error', err => {
- console.log(err)
- if (!this.updateTimeout) return
- this.setVersionModalVisible({ isError: true })
+ ipcRenderer.on('update-error', (event, err) => {
+ // console.log(err)
this.clearUpdateTimeout()
+ this.setVersionModalVisible({ isError: true })
this.$nextTick(() => {
this.showUpdateModal()
})
})
- ipcRenderer.on('update-progress', progress => {
- console.log(progress)
+ ipcRenderer.on('update-progress', (event, progress) => {
+ // console.log(progress)
this.setDownloadProgress(progress)
})
ipcRenderer.on('update-downloaded', info => {
- console.log(info)
+ // console.log(info)
this.clearUpdateTimeout()
- this.setVersionModalVisible({ isError: false })
- this.showUpdateModal()
+ this.setVersionModalVisible({ isDownloaded: true })
+ this.$nextTick(() => {
+ this.showUpdateModal()
+ })
})
ipcRenderer.on('update-not-available', () => {
- if (!this.updateTimeout) return
- if (this.setting.ignoreVersion) this.setSetting(Object.assign({}, this.setting, { ignoreVersion: null }))
this.clearUpdateTimeout()
this.setNewVersion({
version: this.version.version,
@@ -143,11 +149,11 @@ export default {
// 更新超时定时器
this.updateTimeout = setTimeout(() => {
this.updateTimeout = null
- this.setVersionModalVisible({ isError: true })
+ this.setVersionModalVisible({ isTimeOut: true })
this.$nextTick(() => {
this.showUpdateModal()
})
- }, 180000)
+ }, 60 * 30 * 1000)
this.initData()
this.globalObj.apiSource = this.setting.apiSource
@@ -192,12 +198,18 @@ export default {
showUpdateModal() {
(this.version.newVersion && this.version.newVersion.history ? Promise.resolve(this.version.newVersion) : this.getVersionInfo().then(body => {
this.setNewVersion(body)
- if (body.version !== this.setting.ignoreVersion) this.setSetting(Object.assign({}, this.setting, { ignoreVersion: null }))
return body
- })).then(body => {
- if (body.version === this.version.version) return
- if (this.version.isError && body.version === this.setting.ignoreVersion) return
-
+ })).catch(() => {
+ this.setVersionModalVisible({ isUnknow: true })
+ let result = {
+ version: '0.0.0',
+ desc: null,
+ }
+ this.setNewVersion(result)
+ return result
+ }).then(result => {
+ if (result.version === this.version.version) return
+ console.log(this.version)
this.$nextTick(() => {
this.setVersionModalVisible({ isShow: true })
})
diff --git a/src/renderer/components/material/VersionModal.vue b/src/renderer/components/material/VersionModal.vue
index dce871dc..4235e062 100644
--- a/src/renderer/components/material/VersionModal.vue
+++ b/src/renderer/components/material/VersionModal.vue
@@ -1,7 +1,31 @@
-material-modal(:show="version.showModal" @close="handleClose")
- main(:class="$style.main" v-if="version.newVersion")
- h2 {{ version.isError ? (isUnknow ? '❓ 版本信息获取失败 ❓' : '🌟发现新版本🌟') : '🚀程序更新🚀'}}
+material-modal(:show="version.showModal" @close="handleClose" v-if="version.newVersion")
+ main(:class="$style.main" v-if="version.isDownloaded")
+ h2 🚀程序更新🚀
+
+ div.scroll(:class="$style.info")
+ div(:class="$style.current")
+ h3 最新版本:{{version.newVersion.version}}
+ h3 当前版本:{{version.version}}
+ h3 版本变化:
+ p(:class="$style.desc" v-html="version.newVersion.desc")
+ div(:class="[$style.history, $style.desc]" v-if="history.length")
+ h3 历史版本:
+ div(:class="$style.item" v-for="ver in history")
+ h4 v{{ver.version}}
+ p(v-html="ver.desc")
+ div(:class="$style.footer")
+ div(:class="$style.desc")
+ p 新版本已下载完毕,
+ p
+ | 你可以选择
+ strong 立即重启更新
+ | 或稍后
+ strong 关闭程序时
+ | 自动更新~
+ material-btn(:class="$style.btn" @click.onec="handleRestartClick") 立即重启更新
+ main(:class="$style.main" v-else-if="version.isError && !version.isUnknow && version.newVersion.version != version.version")
+ h2 ❌ 版本更新出错 ❌
div.scroll(:class="$style.info")
div(:class="$style.current")
@@ -15,44 +39,97 @@ material-modal(:show="version.showModal" @close="handleClose")
h4 v{{ver.version}}
p(v-html="ver.desc")
- div(:class="$style.footer" v-if="version.isError")
- div(:class="$style.desc" v-if="!isUnknow")
+ div(:class="$style.footer")
+ div(:class="$style.desc")
p 发现有新版本啦,但是自动更新功能出问题了,
p
- | 你现在可以选择继续使用当前版本或
- strong 去发布页下载新版本
- | ,
+ | 你可以去
+ strong.hover.underline(@click="handleOpenUrl('https://github.com/lyswhut/lx-music-desktop/releases')" title="点击打开") 软件发布页
+ | 或
+ strong.hover.underline(@click="handleOpenUrl('https://www.lanzous.com/b906260/')" title="点击打开") 网盘
+ | (密码:
+ strong.hover(@click="handleCopy('glqw')" title="点击复制") glqw
+ | ) 下载新版本,
p
| 国内Windows/MAC用户推荐到
- strong.hover.underline(@click="handleOpenUrl('https://www.lanzous.com/b906260/')") 网盘(点击打开)
- | 下载,密码:
- strong.hover(@click="handleCopy('glqw')" title="点击复制") glqw
- div(:class="$style.btns")
- material-btn(:class="$style.btn" @click.onec="handleIgnoreClick") 忽略该版本
- material-btn(:class="$style.btn" @click.onec="handleOpenUrl('https://github.com/lyswhut/lx-music-desktop#readme')") 去软件发布页
- div(:class="$style.footer" v-else)
- div(:class="$style.desc")
- p 新版本已下载完毕,
- p
- | 你可以选择
- strong 立即重启更新
- | 或稍后
- strong 关闭程序时
- | 自动更新~
- material-btn(:class="$style.btn" @click.onec="handleRestartClick") 立即重启更新
+ strong 网盘
+ | 下载。
+ main(:class="$style.main" v-else-if="version.isTimeOut")
+ h2 ❗️ 新版本下载超时 ❗️
+ div(:class="$style.desc")
+ p 你当前所在网络访问GitHub较慢,导致新版本下载超时(已经下了半个钟了😳),建议手动更新版本!
+ p
+ | 你可以去
+ material-btn(min @click="handleOpenUrl('https://github.com/lyswhut/lx-music-desktop/releases')" title="点击打开") 软件发布页
+ | 或
+ material-btn(min @click="handleOpenUrl('https://www.lanzous.com/b906260/')" title="点击打开") 网盘
+ | (密码:
+ strong.hover(@click="handleCopy('glqw')" title="点击复制") glqw
+ | )下载新版本,
+ p
+ | 国内Windows/MAC用户推荐到
+ strong 网盘
+ | 下载。
+ p 当前下载进度:{{progress}}
+ main(:class="$style.main" v-else-if="version.isUnknow")
+ h2 ❓ 获取最新版本信息失败 ❓
+ div.scroll(:class="$style.info")
+ div(:class="$style.current")
+ h3 当前版本:{{version.version}}
+ div(:class="$style.desc")
+ p 更新信息获取失败,可能是无法访问Github导致的,请手动检查更新!
+ p
+ | 检查方法:打开
+ material-btn(min @click="handleOpenUrl('https://github.com/lyswhut/lx-music-desktop/releases')" title="点击打开") 软件发布页
+ | 或
+ material-btn(min @click="handleOpenUrl('https://www.lanzous.com/b906260/')" title="点击打开") 网盘
+ | (密码:
+ strong.hover(@click="handleCopy('glqw')" title="点击复制") glqw
+ | )查看它们的
+ strong 版本号
+ | 与当前版本({{version.version}})对比是否一样,
+ p 若一样则不必理会该弹窗,直接关闭即可,否则请手动下载新版本更新。
+ main(:class="$style.main" v-else)
+ h2 🌟发现新版本🌟
+
+ div.scroll(:class="$style.info")
+ div(:class="$style.current")
+ h3 最新版本:{{version.newVersion.version}}
+ h3 当前版本:{{version.version}}
+ h3 版本变化:
+ p(:class="$style.desc" v-html="version.newVersion.desc")
+ div(:class="[$style.history, $style.desc]" v-if="history.length")
+ h3 历史版本:
+ div(:class="$style.item" v-for="ver in history")
+ h4 v{{ver.version}}
+ p(v-html="ver.desc")
+
+ div(:class="$style.footer")
+ div(:class="$style.desc")
+ p 发现有新版本啦,正在努力更新中,若下载太慢可以手动更新哦~
+ p
+ | 手动更新可以去
+ strong.hover.underline(@click="handleOpenUrl('https://github.com/lyswhut/lx-music-desktop/releases')" title="点击打开") 软件发布页
+ | 或
+ strong.hover.underline(@click="handleOpenUrl('https://www.lanzous.com/b906260/')" title="点击打开") 网盘
+ | (密码:
+ strong.hover(@click="handleCopy('glqw')" title="点击复制") glqw
+ | ) 下载,
+ p 国内Windows/MAC用户推荐到网盘下载。
+ p 当前下载进度:{{progress}}