You've already forked lx-music-desktop
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b3aab2faf | ||
|
|
893d20b4e9 | ||
|
|
32e421356f | ||
|
|
9858170e61 | ||
|
|
16711e33e8 | ||
|
|
f534e11acb | ||
|
|
2ff0f4b102 | ||
|
|
5b2a44e3bd | ||
|
|
0b06206d34 | ||
|
|
cb93dfa218 |
50
CHANGELOG.md
50
CHANGELOG.md
@@ -6,6 +6,56 @@ 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.3](https://github.com/lyswhut/lx-music-desktop/compare/v0.2.2...v0.2.3) - 2019-08-22
|
||||
|
||||
### 新增
|
||||
|
||||
- 新增任务栏程序标题改变功能(播放歌曲时任务栏标题将显示当前播放的歌曲)
|
||||
|
||||
### 修复
|
||||
|
||||
- 使用临时接口时,试听列表中的下载按钮仍然能点击的Bug
|
||||
- 修复某些情况下歌曲链接未能缓存的问题
|
||||
|
||||
### 移除
|
||||
|
||||
- 移除临时接口(因服务器被攻击,本接口已关闭)
|
||||
- 移除列表栏设置的隐藏专辑栏选项(感觉这个设置并没有什么luan用,并且还会打破布局)
|
||||
|
||||
## [0.2.2](https://github.com/lyswhut/lx-music-desktop/compare/v0.2.2...v0.2.2) - 2019-08-22
|
||||
|
||||
### 新增
|
||||
|
||||
- 新增任务栏程序标题改变功能(播放歌曲时任务栏标题将显示当前播放的歌曲)
|
||||
|
||||
### 修复
|
||||
|
||||
- 使用临时接口时,试听列表中的下载按钮仍然能点击的Bug
|
||||
- 修复某些情况下歌曲链接未能缓存的问题
|
||||
|
||||
### 移除
|
||||
|
||||
- 移除临时接口(因服务器被攻击,本接口已关闭)
|
||||
- 移除列表栏设置的隐藏专辑栏选项(感觉这个设置并没有什么luan用,并且还会打破布局)
|
||||
|
||||
## [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
|
||||
|
||||
### 优化
|
||||
|
||||
- 新增歌曲URL存储,当URL无效时才重新获取,以减少接口不稳定的影响
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复歌曲加载无法加载时自动切换混乱的Bug
|
||||
- 修复移除列表最后一首歌曲时播放器不停止播放的问题
|
||||
|
||||
## [0.2.0](https://github.com/lyswhut/lx-music-desktop/compare/v0.1.6...v0.2.0) - 2019-08-20
|
||||
|
||||
### 新增
|
||||
|
||||
53
README.md
53
README.md
@@ -1,24 +1,34 @@
|
||||
# 洛雪音乐助手桌面版
|
||||
<p align="center"><a href="https://github.com/lyswhut/lx-music-desktop"><img width="200" src="https://github.com/lyswhut/lx-music-desktop/blob/master/doc/images/icon.png" alt="lx-music logo"></a></p>
|
||||
|
||||
[![GitHub release][1]][2]
|
||||
<p align="center">
|
||||
<a href="https://github.com/lyswhut/lx-music-desktop/releases"><img src="https://img.shields.io/github/release/lyswhut/lx-music-desktop" alt="Release version"></a>
|
||||
<a href="https://ci.appveyor.com/project/lyswhut/lx-music-desktop"><img src="https://ci.appveyor.com/api/projects/status/flrsqd5ymp8fnte5?svg=true" alt="Build status"></a>
|
||||
<a href="https://github.com/lyswhut/lx-music-desktop/releases"><img src="https://img.shields.io/github/downloads/lyswhut/lx-music-desktop/latest/total" alt="Downloads"></a>
|
||||
<a href="https://github.com/lyswhut/lx-music-desktop/tree/dev"><img src="https://img.shields.io/github/package-json/v/lyswhut/lx-music-desktop/dev" alt="Dev branch version"></a>
|
||||
<!-- <a href="https://github.com/lyswhut/lx-music-desktop/blob/master/LICENSE"><img src="https://img.shields.io/github/license/lyswhut/lx-music-desktop" alt="License"></a> -->
|
||||
</p>
|
||||
|
||||
<!-- [![GitHub release][1]][2]
|
||||
[![Build status][3]][4]
|
||||
[![GitHub Releases Download][5]][6]
|
||||
[![dev branch][7]][8]
|
||||
<!-- [![GitHub license][9]][10] -->
|
||||
[![GitHub license][9]][10] -->
|
||||
|
||||
[1]: https://img.shields.io/github/release/lyswhut/lx-music-desktop
|
||||
<!-- [1]: https://img.shields.io/github/release/lyswhut/lx-music-desktop
|
||||
[2]: https://github.com/lyswhut/lx-music-desktop/releases
|
||||
[3]: https://ci.appveyor.com/api/projects/status/flrsqd5ymp8fnte5?svg=true
|
||||
[4]: https://ci.appveyor.com/project/lyswhut/lx-music-desktop
|
||||
[5]: https://img.shields.io/github/downloads/lyswhut/lx-music-desktop/latest/total
|
||||
<!-- [5]: https://img.shields.io/github/downloads/lyswhut/lx-music-desktop/total -->
|
||||
[5]: https://img.shields.io/github/downloads/lyswhut/lx-music-desktop/total
|
||||
[6]: https://github.com/lyswhut/lx-music-desktop/releases
|
||||
[7]: https://img.shields.io/github/package-json/v/lyswhut/lx-music-desktop/dev
|
||||
[8]: https://github.com/lyswhut/lx-music-desktop/tree/dev
|
||||
[9]: https://img.shields.io/github/license/lyswhut/lx-music-desktop
|
||||
<!-- [10]: https://github.com/lyswhut/lx-music-desktop/blob/master/LICENSE -->
|
||||
[10]: https://github.com/lyswhut/lx-music-desktop/blob/master/LICENSE -->
|
||||
|
||||
## 说明
|
||||
<h2 align="center">洛雪音乐助手桌面版</h2>
|
||||
|
||||
### 说明
|
||||
|
||||
一个基于 Electron + Vue 开发的 Windows 版音乐软件。
|
||||
|
||||
@@ -27,13 +37,22 @@
|
||||
- Electron 6.x
|
||||
- Vue 2.x
|
||||
|
||||
其他说明:TODO
|
||||
软件变化请查看:[更新日志](https://github.com/lyswhut/lx-music-desktop/blob/master/CHANGELOG.md)<br>
|
||||
软件下载请转到:[发布页面](https://github.com/lyswhut/lx-music-desktop/releases)<br>
|
||||
或者到网盘下载:<br>
|
||||
`https://www.lanzous.com/b906260/`<br>
|
||||
`密码:glqw`
|
||||
|
||||
软件变化请查看:[更新日志](https://github.com/lyswhut/lx-music-desktop/blob/master/CHANGELOG.md)
|
||||
#### 关于软件更新
|
||||
|
||||
感谢 <https://github.com/messoer> 提供的部分音乐API!
|
||||
软件启动时若发现新版本时会自动从本仓库下载安装包,下载完毕会弹窗提示更新。<br>
|
||||
若下载未完成时软件被关闭,下次启动软件会再次自动下载。<br>
|
||||
目前暂未添加跳过更新某个版本的功能。<br>
|
||||
**注意:**绿色版的软件更新功能不可用!
|
||||
|
||||
## 使用方法
|
||||
### 源码使用方法
|
||||
|
||||
环境要求:Node.js 12.x
|
||||
|
||||
```bash
|
||||
# 开发模式
|
||||
@@ -47,6 +66,14 @@ npm run pack
|
||||
|
||||
```
|
||||
|
||||
## License
|
||||
### UI界面
|
||||
|
||||
Apache License 2.0
|
||||
<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>
|
||||
|
||||
### 致谢
|
||||
|
||||
感谢 [@messoer](https://github.com/messoer) 提供的部分音乐API!
|
||||
|
||||
### 许可证
|
||||
|
||||
[Apache License 2.0](https://github.com/lyswhut/lx-music-desktop/blob/master/LICENSE)
|
||||
|
||||
@@ -4,14 +4,14 @@ platform:
|
||||
cache:
|
||||
- node_modules
|
||||
- '%APPDATA%\npm-cache'
|
||||
# - '%USERPROFILE%\.electron'
|
||||
- '%LOCALAPPDATA%\electron\Cache'
|
||||
|
||||
install:
|
||||
- ps: Install-Product node 12 x64
|
||||
- npm install
|
||||
|
||||
build_script:
|
||||
- npm run pub:gh
|
||||
- npm run publish:gh
|
||||
|
||||
test: off
|
||||
|
||||
|
||||
@@ -7,11 +7,6 @@ module.exports = {
|
||||
libraryTarget: 'commonjs2',
|
||||
path: path.join(__dirname, '../../dist/electron'),
|
||||
},
|
||||
externals: [
|
||||
// suppress electron-debug warning
|
||||
// see https://github.com/SimulatedGREG/electron-vue/issues/498
|
||||
{ 'electron-debug': 'electron-debug' },
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
common: path.join(__dirname, '../../src/common'),
|
||||
|
||||
BIN
doc/images/app.png
Normal file
BIN
doc/images/app.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
BIN
doc/images/icon.png
Normal file
BIN
doc/images/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lx-music-desktop",
|
||||
"version": "0.1.4",
|
||||
"version": "0.2.3",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
49
package.json
49
package.json
@@ -1,12 +1,31 @@
|
||||
{
|
||||
"name": "lx-music-desktop",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.3",
|
||||
"description": "一个免费的音乐下载助手",
|
||||
"main": "./dist/electron/main.js",
|
||||
"productName": "lx-music-desktop",
|
||||
"scripts": {
|
||||
"pack": "node build-config/pack.js && npm run pack:win:setup",
|
||||
"pack:win": "npm run pack:win:setup && npm run pack:win:7z",
|
||||
"pack:win:setup": "cross-env TARGET=Setup ARCH=x64_x86 electron-builder -w=nsis",
|
||||
"pack:win:portable": "npm run pack:win:portable:x64_x86 && npm run pack:win:portable:x64 && npm run pack:win:portable:x86",
|
||||
"pack:win:portable:x64_x86": "cross-env TARGET=便携版 ARCH=x64_x86 electron-builder -w=portable --x64 --ia32",
|
||||
"pack:win:portable:x64": "cross-env TARGET=便携版 ARCH=x64 electron-builder -w=portable --x64",
|
||||
"pack:win:portable:x86": "cross-env TARGET=便携版 ARCH=x86 electron-builder -w=portable --ia32",
|
||||
"pack:win:7z": "npm run pack:win:7z:x64 && npm run pack:win:7z:x86",
|
||||
"pack:win:7z:x64": "cross-env TARGET=绿色版 ARCH=x64 electron-builder -w=7z --x64",
|
||||
"pack:win:7z:x86": "cross-env TARGET=绿色版 ARCH=x86 electron-builder -w=7z --ia32",
|
||||
"publish": "node publish",
|
||||
"pub:gh": "node build-config/pack.js && electron-builder --win -p always",
|
||||
"pack": "node build-config/pack.js && electron-builder -w",
|
||||
"publish:gh": "node build-config/pack.js && npm run publish:win",
|
||||
"publish:win": "npm run publish:win:setup && npm run publish:win:7z",
|
||||
"publish:win:setup": "cross-env TARGET=Setup ARCH=x64_x86 electron-builder -w=nsis --x64 --ia32 -p always",
|
||||
"publish:win:portable": "npm run publish:win:portable:x64_x86 && npm run publish:win:portable:x64 && npm run publish:win:portable:x86",
|
||||
"publish:win:portable:x64_x86": "cross-env TARGET=portable ARCH=x64_x86 electron-builder -w=portable --x64 --ia32 -p onTagOrDraft",
|
||||
"publish:win:portable:x64": "cross-env TARGET=portable ARCH=x64 electron-builder -w=portable --x64 -p onTagOrDraft",
|
||||
"publish:win:portable:x86": "cross-env TARGET=portable ARCH=x86 electron-builder -w=portable --ia32 -p onTagOrDraft",
|
||||
"publish:win:7z": "npm run publish:win:7z:x64 && npm run publish:win:7z:x86",
|
||||
"publish:win:7z:x64": "cross-env TARGET=green ARCH=x64 electron-builder -w=7z --x64 -p onTagOrDraft",
|
||||
"publish:win:7z:x86": "cross-env TARGET=green ARCH=x86 electron-builder -w=7z --ia32 -p onTagOrDraft",
|
||||
"pack:linux": "node build-config/pack.js && electron-builder -l",
|
||||
"pack:dir": "node build-config/pack.js && electron-builder --dir",
|
||||
"dev": "node build-config/runner-dev.js",
|
||||
@@ -37,15 +56,7 @@
|
||||
"win": {
|
||||
"icon": "src/static/icons/lunch.ico",
|
||||
"legalTrademarks": "lyswhut",
|
||||
"target": [
|
||||
{
|
||||
"arch": [
|
||||
"ia32",
|
||||
"x64"
|
||||
],
|
||||
"target": "nsis"
|
||||
}
|
||||
]
|
||||
"artifactName": "${productName} v${version} ${env.ARCH} ${env.TARGET}.${ext}"
|
||||
},
|
||||
"linux": {
|
||||
"target": [
|
||||
@@ -76,7 +87,8 @@
|
||||
"language": "2052",
|
||||
"allowToChangeInstallationDirectory": true,
|
||||
"differentialPackage": true,
|
||||
"license": "./license.rtf"
|
||||
"license": "./license.rtf",
|
||||
"shortcutName": "lx-music"
|
||||
},
|
||||
"publish": [
|
||||
{
|
||||
@@ -90,8 +102,15 @@
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/lyswhut/lx-music-desktop.git"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "lyswhut",
|
||||
"keywords": [
|
||||
"music-player",
|
||||
"electron-app",
|
||||
"vuejs2"
|
||||
],
|
||||
"author": {
|
||||
"name": "lyswhut",
|
||||
"email": "lyswuhut@qq.com"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/lyswhut/lx-music-desktop/issues"
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
### 新增
|
||||
|
||||
- 新增**百度音乐**排行榜及其音乐直接试听与下载
|
||||
- 新增网易云排行榜音乐直接试听与下载(目前仅支持128k音质)
|
||||
- 新增酷狗排行榜音乐直接试听与下载(目前仅支持128k音质)
|
||||
- 新增任务栏程序标题改变功能(播放歌曲时任务栏标题将显示当前播放的歌曲)
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复更新弹窗历史版本描述多余的换行问题
|
||||
- 修复歌曲无法播放的情况下歌词仍会播放的问题
|
||||
- 使用临时接口时,试听列表中的下载按钮仍然能点击的Bug
|
||||
- 修复某些情况下歌曲链接未能缓存的问题
|
||||
|
||||
### 移除
|
||||
|
||||
- 移除临时接口(因服务器被攻击,本接口已关闭)
|
||||
- 移除列表栏设置的隐藏专辑栏选项(感觉这个设置并没有什么luan用,并且还会打破布局)
|
||||
|
||||
@@ -1,7 +1,19 @@
|
||||
{
|
||||
"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",
|
||||
"version": "0.2.3",
|
||||
"desc": "<h3>新增</h3>\n<ul>\n<li>新增任务栏程序标题改变功能(播放歌曲时任务栏标题将显示当前播放的歌曲)</li>\n</ul>\n<h3>修复</h3>\n<ul>\n<li>使用临时接口时,试听列表中的下载按钮仍然能点击的Bug</li>\n<li>修复某些情况下歌曲链接未能缓存的问题</li>\n</ul>\n<h3>移除</h3>\n<ul>\n<li>移除临时接口(因服务器被攻击,本接口已关闭)</li>\n<li>移除列表栏设置的隐藏专辑栏选项(感觉这个设置并没有什么luan用,并且还会打破布局)</li>\n</ul>\n",
|
||||
"history": [
|
||||
{
|
||||
"version": "0.2.2",
|
||||
"desc": "<h3>修复</h3>\n<ul>\n<li>修复下载过程中出错重试5次都失败后不会自动开始下一个任务的Bug</li>\n<li>修复播放到一半URL过期时不会刷新URL直接播放下一首的问题</li>\n</ul>\n"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"version": "0.1.6",
|
||||
"desc": "<h3>修复</h3>\n<ul>\n<li>修复列表多选音源限制Bug</li>\n</ul>\n"
|
||||
|
||||
@@ -3,7 +3,7 @@ html(lang="cn")
|
||||
meta(charset="UTF-8")
|
||||
meta(name="viewport" content="width=device-width, initial-scale=1.0")
|
||||
meta(http-equiv="X-UA-Compatible" content="ie=edge")
|
||||
title= require('../package.json').name
|
||||
title 洛雪音乐助手
|
||||
|
||||
body
|
||||
#root
|
||||
|
||||
@@ -3,6 +3,7 @@ const { autoUpdater } = require('electron-updater')
|
||||
const { mainOn } = require('../../common/icp')
|
||||
|
||||
autoUpdater.logger = log
|
||||
// autoUpdater.autoDownload = false
|
||||
autoUpdater.logger.transports.file.level = 'info'
|
||||
log.info('App starting...')
|
||||
|
||||
@@ -62,12 +63,14 @@ module.exports = win => {
|
||||
})
|
||||
autoUpdater.on('update-available', (ev, info) => {
|
||||
sendStatusToWindow('Update available.')
|
||||
// win.webContents.send('update-available')
|
||||
})
|
||||
autoUpdater.on('update-not-available', (ev, info) => {
|
||||
sendStatusToWindow('Update not available.')
|
||||
})
|
||||
autoUpdater.on('error', (ev, err) => {
|
||||
sendStatusToWindow('Error in auto-updater.')
|
||||
// win.webContents.send('update-error')
|
||||
})
|
||||
autoUpdater.on('download-progress', (ev, progressObj) => {
|
||||
sendStatusToWindow('Download progress...')
|
||||
|
||||
@@ -53,6 +53,7 @@ export default {
|
||||
},
|
||||
defaultList: {
|
||||
handler(n) {
|
||||
// console.log(n)
|
||||
this.electronStore.set('list.defaultList', n)
|
||||
},
|
||||
deep: true,
|
||||
@@ -86,7 +87,7 @@ export default {
|
||||
this.getVersionInfo().then(body => {
|
||||
this.setNewVersion(body)
|
||||
this.$nextTick(() => {
|
||||
this.setVersionVisible(true)
|
||||
this.setVersionVisible({ isShow: true })
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -110,10 +111,11 @@ export default {
|
||||
},
|
||||
initPlayList() {
|
||||
let defaultList = this.electronStore.get('list.defaultList')
|
||||
// console.log(defaultList)
|
||||
if (defaultList) {
|
||||
defaultList.list.forEach(m => {
|
||||
m.typeUrl = {}
|
||||
})
|
||||
// defaultList.list.forEach(m => {
|
||||
// m.typeUrl = {}
|
||||
// })
|
||||
this.initDefaultList(defaultList)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -41,8 +41,9 @@ div(:class="$style.player")
|
||||
<script>
|
||||
import Lyric from 'lrc-file-parser'
|
||||
import { rendererSend } from '../../../common/icp'
|
||||
import { formatPlayTime2, getRandom, checkPath } from '../../utils'
|
||||
import { formatPlayTime2, getRandom, checkPath, setTitle } from '../../utils'
|
||||
import { mapGetters, mapActions, mapMutations } from 'vuex'
|
||||
import { requestMsg } from '../../utils/message'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -68,7 +69,9 @@ export default {
|
||||
text: '',
|
||||
line: 0,
|
||||
},
|
||||
retryNum: 0,
|
||||
delayNextTimeout: null,
|
||||
audioErrorTime: 0,
|
||||
// retryNum: 0,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -119,8 +122,13 @@ export default {
|
||||
? n.findIndex(s => s.musicInfo.songmid === this.musicInfo.songmid)
|
||||
: n.findIndex(s => s.songmid === this.musicInfo.songmid)
|
||||
if (index < 0) {
|
||||
this.fixPlayIndex(this.playIndex - 1)
|
||||
if (n.length) this.handleNext()
|
||||
// console.log(this.playIndex)
|
||||
if (n.length) {
|
||||
this.fixPlayIndex(this.playIndex - 1)
|
||||
this.handleNext()
|
||||
} else {
|
||||
this.setPlayIndex(-1)
|
||||
}
|
||||
} else {
|
||||
this.fixPlayIndex(index)
|
||||
}
|
||||
@@ -167,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 < 5) {
|
||||
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
|
||||
@@ -191,13 +200,15 @@ export default {
|
||||
// } else {
|
||||
// this.handleNext()
|
||||
// }
|
||||
this.status = '音频加载出错,2 两秒后切换下一首'
|
||||
setTimeout(() => {
|
||||
this.handleNext()
|
||||
}, 2000)
|
||||
this.status = '音频加载出错,5 秒后切换下一首'
|
||||
this.addDelayNextTimeout()
|
||||
})
|
||||
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 = '音乐加载中...'
|
||||
})
|
||||
@@ -241,8 +252,10 @@ export default {
|
||||
},
|
||||
play() {
|
||||
console.log('play', this.playIndex)
|
||||
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)) {
|
||||
@@ -264,6 +277,20 @@ export default {
|
||||
this.setLrc(targetSong)
|
||||
}
|
||||
},
|
||||
checkDelayNextTimeout() {
|
||||
console.log(this.delayNextTimeout)
|
||||
if (this.delayNextTimeout) {
|
||||
clearTimeout(this.delayNextTimeout)
|
||||
this.delayNextTimeout = null
|
||||
}
|
||||
},
|
||||
addDelayNextTimeout() {
|
||||
this.checkDelayNextTimeout()
|
||||
this.delayNextTimeout = setTimeout(() => {
|
||||
this.delayNextTimeout = null
|
||||
this.handleNext()
|
||||
}, 5000)
|
||||
},
|
||||
handleNext() {
|
||||
// if (this.list.listName === null) return
|
||||
let list
|
||||
@@ -276,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)
|
||||
let index
|
||||
switch (this.setting.player.togglePlayMethod) {
|
||||
case 'listLoop':
|
||||
@@ -307,14 +334,14 @@ export default {
|
||||
startPlay() {
|
||||
this.isPlay = true
|
||||
if (this.musicInfo.lrc) this.lyric.lrc.play(this.audio.currentTime * 1000)
|
||||
this.setAppName()
|
||||
this.setAppTitle()
|
||||
this.sendProgressEvent(this.progress, 'normal')
|
||||
},
|
||||
stopPlay() {
|
||||
this.isPlay = false
|
||||
this.lyric.lrc.pause()
|
||||
this.sendProgressEvent(this.progress, 'paused')
|
||||
this.clearAppName()
|
||||
this.clearAppTitle()
|
||||
},
|
||||
setProgess(e) {
|
||||
this.audio.currentTime =
|
||||
@@ -349,19 +376,13 @@ export default {
|
||||
this.musicInfo.url = targetSong.typeUrl[type]
|
||||
this.status = '歌曲链接获取中...'
|
||||
|
||||
let urlP = this.musicInfo.url && !isRefresh
|
||||
? Promise.resolve()
|
||||
: this.getUrl({ musicInfo: targetSong, type }).then(() => {
|
||||
this.musicInfo.url = targetSong.typeUrl[type]
|
||||
})
|
||||
|
||||
urlP.then(() => {
|
||||
this.audio.src = this.musicInfo.url
|
||||
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
|
||||
setTimeout(() => {
|
||||
this.handleNext()
|
||||
}, 2000)
|
||||
this.addDelayNextTimeout()
|
||||
return Promise.reject(err)
|
||||
})
|
||||
},
|
||||
setImg(targetSong) {
|
||||
@@ -411,13 +432,11 @@ export default {
|
||||
mode: mode || 'normal',
|
||||
})
|
||||
},
|
||||
setAppName() {
|
||||
// rendererSend('appName', {
|
||||
// name: `${this.musicInfo.name} - ${this.musicInfo.singer}`,
|
||||
// })
|
||||
setAppTitle() {
|
||||
setTitle(`${this.musicInfo.name} - ${this.musicInfo.singer}`)
|
||||
},
|
||||
clearAppName() {
|
||||
// rendererSend('appName')
|
||||
clearAppTitle() {
|
||||
setTitle()
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template lang="pug">
|
||||
div(:class="$style.checkbox")
|
||||
input(:type="need ? 'radio' : 'checkbox'" :id="id" :value="value" :name="name" @change="change" v-model="bool")
|
||||
input(:type="need ? 'radio' : 'checkbox'" :id="id" :disabled="disabled" :value="value" :name="name" @change="change" v-model="bool")
|
||||
label(:for="id" :class="$style.content")
|
||||
div(v-if="indeterminate")
|
||||
svg(v-show="indeterminate" version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' height='100%' width="100%" viewBox='0 32 448 448' space='preserve')
|
||||
@@ -34,6 +34,10 @@ export default {
|
||||
default: false,
|
||||
},
|
||||
label: {},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
indeterminate: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
@@ -111,6 +115,11 @@ export default {
|
||||
|
||||
> input {
|
||||
display: none;
|
||||
&[disabled] {
|
||||
+ .content {
|
||||
opacity: .5;
|
||||
}
|
||||
}
|
||||
&:checked {
|
||||
+ .content {
|
||||
> div {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { author, name } from '../../../package.json'
|
||||
export default {
|
||||
getVersionInfo() {
|
||||
return new Promise((resolve, reject) => {
|
||||
httpGet(`https://raw.githubusercontent.com/${author}/${name}/master/publish/version.json`, (err, resp, body) => {
|
||||
httpGet(`https://raw.githubusercontent.com/${author.name}/${name}/master/publish/version.json`, (err, resp, body) => {
|
||||
if (err) return reject(err)
|
||||
resolve(body)
|
||||
})
|
||||
|
||||
@@ -70,8 +70,9 @@ const addTask = (list, type, store) => {
|
||||
})
|
||||
}
|
||||
|
||||
const refreshUrl = downloadInfo => {
|
||||
return music[downloadInfo.musicInfo.source].getMusicUrl(downloadInfo.musicInfo, downloadInfo.type).promise
|
||||
const getUrl = (downloadInfo, isRefresh) => {
|
||||
const url = downloadInfo.musicInfo.typeUrl[downloadInfo.type]
|
||||
return url && !isRefresh ? Promise.resolve({ url }) : music[downloadInfo.musicInfo.source].getMusicUrl(downloadInfo.musicInfo, downloadInfo.type).promise
|
||||
}
|
||||
|
||||
// actions
|
||||
@@ -116,12 +117,12 @@ const actions = {
|
||||
// 检查是否可以开始任务
|
||||
if (downloadInfo && downloadInfo != state.downloadStatus.WAITING) commit('setStatus', { downloadInfo, status: state.downloadStatus.WAITING })
|
||||
let result = getStartTask(state.list, state.downloadStatus, rootState.setting.download.maxDownloadNum)
|
||||
if (!result) return downloadInfo && commit('setStatus', { downloadInfo, status: state.downloadStatus.WAITING })
|
||||
if (!result) return
|
||||
if (!downloadInfo) downloadInfo = result
|
||||
|
||||
// 开始任务
|
||||
commit('setStatusText', { downloadInfo, text: '任务初始化中' })
|
||||
commit('onDownload', downloadInfo)
|
||||
commit('setStatusText', { downloadInfo, text: '任务初始化中' })
|
||||
let msg = checkPath(rootState.setting.download.savePath)
|
||||
if (msg) return commit('setStatusText', '检查下载目录出错: ' + msg)
|
||||
const _this = this
|
||||
@@ -137,15 +138,18 @@ const actions = {
|
||||
console.log('on complate')
|
||||
},
|
||||
onError(err) {
|
||||
console.log(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')
|
||||
} if (err.code === 'ETIMEDOUT') {
|
||||
code = 'ETIMEDOUT'
|
||||
} else if (err.code === 'ETIMEDOUT' || err.code == 'ENOTFOUND') {
|
||||
code = err.code
|
||||
} else {
|
||||
console.log('Download failed, Attempting Retry')
|
||||
dls[downloadInfo.key].resume()
|
||||
@@ -157,8 +161,9 @@ const actions = {
|
||||
case '403':
|
||||
case '410':
|
||||
case 'ETIMEDOUT':
|
||||
case 'ENOTFOUND':
|
||||
commit('setStatusText', { downloadInfo, text: '链接失效,正在刷新链接' })
|
||||
refreshUrl(downloadInfo).then(result => {
|
||||
getUrl(downloadInfo, true).then(result => {
|
||||
commit('updateUrl', { downloadInfo, url: result.url })
|
||||
commit('setStatusText', { downloadInfo, text: '链接刷新成功' })
|
||||
dls[downloadInfo.key].url = dls[downloadInfo.key].requestURL = result.url
|
||||
@@ -168,9 +173,7 @@ const actions = {
|
||||
console.log(err)
|
||||
_this.dispatch('download/startTask')
|
||||
})
|
||||
return
|
||||
}
|
||||
_this.dispatch('download/startTask')
|
||||
},
|
||||
// onStateChanged(state) {
|
||||
// console.log(state)
|
||||
@@ -192,7 +195,7 @@ const actions = {
|
||||
},
|
||||
}
|
||||
commit('setStatusText', { downloadInfo, text: '获取URL中...' })
|
||||
let p = options.url ? Promise.resolve() : refreshUrl(downloadInfo).then(result => {
|
||||
let p = options.url ? Promise.resolve() : getUrl(downloadInfo).then(result => {
|
||||
commit('updateUrl', { downloadInfo, url: result.url })
|
||||
if (!result.url) return Promise.reject(new Error('获取URL失败'))
|
||||
options.url = result.url
|
||||
|
||||
@@ -22,8 +22,9 @@ const getters = {
|
||||
|
||||
// actions
|
||||
const actions = {
|
||||
getUrl({ commit, state }, { musicInfo, type }) {
|
||||
getUrl({ commit, state }, { musicInfo, type, isRefresh }) {
|
||||
if (urlRequest && urlRequest.cancelHttp) urlRequest.cancelHttp()
|
||||
if (musicInfo.typeUrl[type] && !isRefresh) return Promise.resolve()
|
||||
urlRequest = music[musicInfo.source].getMusicUrl(musicInfo, type)
|
||||
return urlRequest.promise.then(result => {
|
||||
commit('setUrl', { musicInfo, url: result.url, type })
|
||||
@@ -55,7 +56,7 @@ const actions = {
|
||||
// mitations
|
||||
const mutations = {
|
||||
setUrl(state, datas) {
|
||||
datas.musicInfo.typeUrl[datas.type] = datas.url
|
||||
datas.musicInfo.typeUrl = Object.assign({}, datas.musicInfo.typeUrl, { [datas.type]: datas.url })
|
||||
},
|
||||
getPic(state, datas) {
|
||||
datas.musicInfo.img = datas.url
|
||||
@@ -72,6 +73,7 @@ const mutations = {
|
||||
setPlayIndex(state, index) {
|
||||
state.playIndex = index
|
||||
state.changePlay = true
|
||||
// console.log(state.changePlay)
|
||||
},
|
||||
fixPlayIndex(state, index) {
|
||||
state.playIndex = index
|
||||
|
||||
@@ -19,7 +19,7 @@ export default {
|
||||
// val.desc = val.desc.replace(/\n/g, '<br>')
|
||||
state.version.newVersion = val
|
||||
},
|
||||
setVersionVisible(state, val) {
|
||||
state.version.showModal = val
|
||||
setVersionVisible(state, { isShow }) {
|
||||
state.version.showModal = isShow
|
||||
},
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ export default {
|
||||
version,
|
||||
newVersion: null,
|
||||
showModal: false,
|
||||
isError: false,
|
||||
},
|
||||
userInfo: null,
|
||||
setting,
|
||||
|
||||
@@ -209,3 +209,10 @@ export const openUrl = url => {
|
||||
shell.openExternal(url)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置标题
|
||||
*/
|
||||
let dom_title = document.getElementsByTagName('title')[0]
|
||||
export const setTitle = title => {
|
||||
dom_title.innerText = title || '洛雪音乐助手'
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
:indeterminate="isIndeterminate" :title="isSelectAll && !isIndeterminate ? '全不选' : '全选'")
|
||||
th.nobreak(style="width: 25%;") 歌曲名
|
||||
th.nobreak(style="width: 20%;") 歌手
|
||||
th.nobreak(style="width: 20%;" v-if="setting.list.isShowAlbumName") 专辑
|
||||
th.nobreak(style="width: 20%;") 专辑
|
||||
th.nobreak(style="width: 20%;") 操作
|
||||
th.nobreak(style="width: 10%;") 时长
|
||||
div.scroll(:class="$style.tbody")
|
||||
@@ -28,7 +28,7 @@
|
||||
//- span.badge.badge-info(v-if="item._types.ape") APE
|
||||
//- span.badge.badge-success(v-if="item._types.flac") FLAC
|
||||
td.break(style="width: 20%;") {{item.singer}}
|
||||
td.break(style="width: 20%;" v-if="setting.list.isShowAlbumName") {{item.albumName}}
|
||||
td.break(style="width: 20%;") {{item.albumName}}
|
||||
td(style="width: 20%; padding-left: 0; padding-right: 0;")
|
||||
material-list-buttons(:index="index" @btn-click="handleListBtnClick")
|
||||
//- button.btn-info(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k'] || item._types.flac" @click.stop='openDownloadModal(index)') 下载
|
||||
@@ -137,7 +137,6 @@ export default {
|
||||
this.clickIndex = -1
|
||||
},
|
||||
testPlay(index) {
|
||||
if (this.isAPITemp && this.list[index].source != 'kw') return
|
||||
this.setList({ list: this.list, listId: 'test', index })
|
||||
},
|
||||
handleRemove(index) {
|
||||
@@ -146,16 +145,17 @@ export default {
|
||||
handleListBtnClick(info) {
|
||||
switch (info.action) {
|
||||
case 'download':
|
||||
this.musicInfo = this.list[info.index]
|
||||
const minfo = this.list[info.index]
|
||||
if (this.isAPITemp && minfo.source != 'kw') return
|
||||
this.musicInfo = minfo
|
||||
this.$nextTick(() => {
|
||||
this.isShowDownload = true
|
||||
})
|
||||
break
|
||||
case 'play':
|
||||
if (this.isAPITemp && this.list[info.index].source != 'kw') return
|
||||
this.testPlay(info.index)
|
||||
break
|
||||
case 'add':
|
||||
break
|
||||
case 'remove':
|
||||
this.handleRemove(info.index)
|
||||
break
|
||||
|
||||
@@ -19,7 +19,7 @@ div.scroll(:class="$style.setting")
|
||||
h3 音乐来源
|
||||
div
|
||||
material-checkbox(v-for="item in apiSources" :id="`setting_api_source_${item.id}`" @change="handleAPISourceChange(item.id)" :class="$style.gapTop"
|
||||
need v-model="current_setting.apiSource" :value="item.id" :label="item.label" :key="item.id")
|
||||
need v-model="current_setting.apiSource" :disabled="item.disabled" :value="item.id" :label="item.label" :key="item.id")
|
||||
|
||||
dt 播放设置
|
||||
dd(title="都不选时播放完当前歌曲就停止播放")
|
||||
@@ -45,8 +45,8 @@ div.scroll(:class="$style.setting")
|
||||
div
|
||||
material-checkbox(:id="`setting_download_musicName_${item.value}`" :class="$style.gapLeft" name="setting_download_musicName" :value="item.value" :key="item.value" need
|
||||
v-model="current_setting.download.fileName" v-for="item in musicNames" :label="item.name")
|
||||
dt 列表设置
|
||||
dd(title='播放列表是否显示专辑栏')
|
||||
//- dt 列表设置
|
||||
//- dd(title='播放列表是否显示专辑栏')
|
||||
h3 专辑栏
|
||||
div
|
||||
material-checkbox(id="setting_list_showalbum" v-model="current_setting.list.isShowAlbumName" label="是否显示专辑栏")
|
||||
@@ -86,6 +86,10 @@ div.scroll(:class="$style.setting")
|
||||
strong @messoer
|
||||
| !
|
||||
p.small 若有问题可 mail to:lyswhut@qq.com 或到 github 提交 issue
|
||||
p.small
|
||||
| 若觉得好用的话可以去GitHub点个
|
||||
strong star
|
||||
| 支持作者哦~~🍻
|
||||
p
|
||||
small By:
|
||||
| 落雪无痕
|
||||
@@ -142,11 +146,14 @@ export default {
|
||||
apiSources: [
|
||||
{
|
||||
id: 'messoer',
|
||||
label: '由 messoer 提供的接口(推荐,软件的所有功能都可用)<br><span style="line-height: 1.5;"><strong>注意:</strong>本接口10秒内请求数超过100次会封10小时的IP</span>',
|
||||
label: '由 messoer 提供的接口(推荐,软件的所有功能都可用)',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
id: 'temp',
|
||||
label: '临时接口(软件的某些功能将不可用,建议在messoer不可用时再切换到本选项)',
|
||||
// label: '临时接口(软件的某些功能将不可用,建议在messoer不可用时再切换到本选项)',
|
||||
label: '临时接口(因服务器被攻击,本接口已关闭)',
|
||||
disabled: true,
|
||||
},
|
||||
],
|
||||
musicNames: [
|
||||
|
||||
Reference in New Issue
Block a user