Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
lyswhut committed Jan 22, 2022
2 parents c5c89f9 + bebd0e7 commit 0580b05
Show file tree
Hide file tree
Showing 57 changed files with 2,342 additions and 2,804 deletions.
16 changes: 8 additions & 8 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"corejs": "3",
"useBuiltIns": "usage"
}
],
[
"minify",
{
"builtIns": false,
"evaluate": false,
"mangle": false
}
]
// [
// "minify",
// {
// "builtIns": false,
// "evaluate": false,
// "mangle": false
// }
// ]
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
Expand Down
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"plugins": [
"html"
],
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"parserOptions": {
"requireConfigFile": false
},
"rules": {
"no-new": "off",
"camelcase": "off",
Expand Down
5 changes: 1 addition & 4 deletions .ncurc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
module.exports = {
// upgrade: true,
upgrade: true,
// target: 'newest',
reject: [
'webpack-dev-server',
'eslint',
'electron',
'electron-builder',
'chalk',
// 'eslint-config-standard'
]
}
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,32 @@ 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/).

## [1.17.0](https://github.com/lyswhut/lx-music-desktop/compare/v1.16.0...v1.17.0) - 2022-01-22

### 新增

- 新增“便携”功能,在Windows平台下,若程序目录下存在 portable 目录,则自动使用此目录作为数据存储目录
- 新增 Scheme URL 支持,同时发布lx-music-script项目配合使用(一个油猴脚本,可以在浏览器中的官方平台网页直接调用LX Music),Scheme URL的调用说明看Readme.md文档的Scheme URL支持部分
- 新增启动参数`-proxy-server``-proxy-bypass-list`,详细介绍看Readme.md文档的启动参数部分
- 新增桌面歌词是否延迟滚动设置,默认开启,若你不想要桌面歌词延迟滚动可以去设置-桌面歌词设置关掉

### 优化

- 为可视化音频的频谱整体添加频谱均值加成,使频谱显示更有节奏感
- 优化程序初始化逻辑,修复无网络的情况下的初始化问题
- 我的列表-列表名的右击菜单更新已收藏的在线列表时,将始终重新加载,不再使用缓存,解决在原平台更新歌单后,在LX点击更新可能看到的还是在原平台更新前的歌单的问题

### 修复

- 修复代理不生效的问题
- 修复`openDevTools`选项无效的问题
- 修复播放状态的提示问题
- 修复tx源无搜索结果的问题

### 其他

- 更新 Electron 到 v13.6.7

## [1.16.0](https://github.com/lyswhut/lx-music-desktop/compare/v1.15.3...v1.16.0) - 2022-01-01

这算是一个大版本,对主窗口部分的代码逻辑做了较大改动,但由于界面的改动不大,所以没有更新大版本号。
Expand Down
45 changes: 45 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,16 @@ Windows 7 未开启 Aero 效果时桌面歌词会有问题,详情看上面的
- <http://www.pc6.com/edu/168719.html>
- <https://blog.csdn.net/for641/article/details/104811538>

## 数据存储路径

默认情况下,软件的数据存储在:

- Windows:`%APPDATA%/lx-music-desktop`
- Linux:`$XDG_CONFIG_HOME/lx-music-desktop``~/.config/lx-music-desktop`
- macOS:`~/Library/Application/lx-music-desktop`

在Windows平台下,若程序目录下存在`portable`目录,则自动使用此目录作为数据存储目录(v1.17.0新增)。

## 杀毒软件提示有病毒或恶意行为

本人只能保证我写的代码不包含任何**恶意代码****收集用户信息**的行为,并且软件代码已开源,请自行查阅,软件安装包也是由CI拉取源代码构建,构建日志:[GitHub Actions](https://github.com/lyswhut/lx-music-desktop/actions)<br>
Expand All @@ -270,6 +280,41 @@ Windows 7 未开启 Aero 效果时桌面歌词会有问题,详情看上面的

最后,若出现杀毒软件报毒、存在恶意行为,请自行判断选择是否继续使用本软件!

## 启动参数

目前软件已支持的启动参数如下:

- `-search` 启动软件时自动在搜索框搜索指定的内容,例如:`-search="突然的自我 - 伍佰"`
- `-dha` 禁用硬件加速启动(Disable Hardware Acceleration),窗口显示有问题时可以尝试添加此参数启动(v1.6.0起新增)
- `-dt` 以非透明模式启动(Disable Transparent),对于未开启AERO效果的win7系统可加此参数启动以确保界面正常显示(注:该参数对桌面歌词无效),原来的`-nt`参数已重命名为`-dt`(v1.6.0起重命名)
- `-dhmkh` 禁用硬件媒体密钥处理(Disable Hardware Media Key Handling),此选项将禁用Chromium的Hardware Media Key Handling特性(v1.9.0起新增)
- `-proxy-server` 设置代理服务器,代理应用的所有流量,例:`-proxy-server="127.0.0.1:1081"`(不支持设置账号密码,v1.17.0起新增)。注:应用内“设置-网络-代理设置”仅代理接口请求的流量,优先级更高
- `-proxy-bypass-list` 以分号分隔的主机列表绕过代理服务器,例:`-proxy-bypass-list="<local>;*.google.com;*foo.com;1.2.3.4:5678"`(与`-proxy-server`一起使用才有效,v1.17.0起新增)。注:此设置对应用内接口请求无效
- `-play` 启动时播放指定列表的音乐,参数说明:
- `type`:播放类型,目前固定为`songList`
- `source`:播放源,可用值为`kw/kg/tx/wy/mg/myList`,其中`kw/kg/tx/wy/mg`对应各源的在线列表,`myList`为本地列表
- `link`:要播放的在线列表歌单链接、或ID,source为`kw/kg/tx/wy/mg`之一(在线列表)时必传,举例:`./lx-music-desktop -play="type=songList&source=kw&link=歌单URL or ID"`,注意:如果传入URL时必须对URL进行编码后再传入
- `name`:要播放的本地列表歌单名字,source为`myList`时必传,举例:`./lx-music-desktop -play="type=songList&source=myList&name=默认列表"`
- `index`:从列表的哪个位置开始播放,选传,若不传默认播放第一首歌曲,举例:`./lx-music-desktop -play="type=songList&source=myList&name=默认列表&index=2"`

## Scheme URL支持

从v1.17.0起支持 Scheme URL,可以使用此功能从浏览器等场景下调用LX Music,我们开发了一个[油猴脚本](https://github.com/lyswhut/lx-music-script#readme)配套使用<br>
脚本安装地址:<https://greasyfork.org/zh-CN/scripts/438148-lx-msuic-%E8%BE%85%E5%8A%A9%E8%84%9A%E6%9C%AC><br>
以下是目前可用的Scheme URL调用方式:

- URL统一以`lxmusic://`开头
- 此技术目前只支持 Windows、Mac系统
- URL传参以经过URL编码的JSON数据传参,例:`lxmusic://music/play?data=xxxx`,其中`xxxx`为经过URL编码后的JSON数据
- 若无特别说明,源的可用值为:`kw/kg/tx/wy/mg`
- 若无特别说明,音质的可用值为:`128k/320k/flac/flac32bit`

| 描述 | URL | 参数
| --- | --- | ---
| 打开歌单 | `songlist/open` | `source<String>`(源,必须)<br>`id<String/Number>`(歌单ID,可选)<br>`url<String>`(歌单URL,可选)其中ID与URL必需传一个
| 播放歌单 | `songlist/play` | `source<String>`(源,必须)<br>`id<String/Number>`(歌单ID,可选)<br>`url<String>`(歌单URL,可选)其中`id``url`必需传一个<br>`index<Number>`(播放第几首歌,可选,从0开始)
| 播放歌曲 | `music/play` | `name<String>`(歌曲名,必传)<br>`singer<String>`(艺术家名,必传)<br>`source<String>`(源,必传)<br>`songmid<String/Number>`(歌曲ID,必传)<br>`img<String>`(歌曲图片链接,选传)<br>`albumId<String/Number>`(歌曲专辑ID,选传)<br>`interval<String>`(格式化后的歌曲时长,选传,例:`03:55`)<br>`albumName<String>`(歌曲专辑名称,选传)<br>`types<Object>`(歌曲可用音质数组,必传,<br>数组格式:`[{"type": "<音质>", size: "<格式化后的文件大小,选传>", hash: "<kg源必传>"}]`,<br>例:`[{"type": "128k", size: "3.56M"}, {"type": "320k", size: null}]`)<br><br>以下为平台特定参数:<br>`hash<String>`(歌曲hash,kg源必传)<br>`strMediaMid<String>`(歌曲strMediaMid,tx源必传)<br>`albumMid<String>`(歌曲albumMid,tx源专用,选传)<br>`copyrightId<String>`(歌曲copyrightId,mg源必传)<br>`lrcUrl<String>`(歌曲lrcUrl,mg源专用,选传)

## 自定义源脚本编写说明

文件请使用UTF-8编码格式编写,脚本所用编程语言为JavaScript,可以使用ES6+语法,脚本与应用的交互是使用类似事件收发的方式进行,这是一个基本的脚本例子:
Expand Down
45 changes: 29 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,35 @@
或者到网盘下载(网盘内有MAC、windows版):`https://www.lanzoui.com/b0bf2cfa/` 密码:`glqw`(若链接无法打开请百度:蓝奏云链接打不开)<br>
使用常见问题请转至:[常见问题](https://github.com/lyswhut/lx-music-desktop/blob/master/FAQ.md)

#### Scheme URL支持

从v1.17.0起支持 Scheme URL,可以使用此功能从浏览器等场景下调用LX Music,我们开发了一个[油猴脚本](https://github.com/lyswhut/lx-music-script#readme)配套使用,<br>
脚本安装地址:<https://greasyfork.org/zh-CN/scripts/438148-lx-msuic-%E8%BE%85%E5%8A%A9%E8%84%9A%E6%9C%AC><br>

#### 启动参数

目前软件已支持的启动参数如下:

- `-proxy-server` 设置代理服务器,代理应用的所有流量
- `-proxy-bypass-list` 以分号分隔的主机列表绕过代理服务器
- `-play` 启动时播放指定列表的音乐
- `-search` 启动软件时自动在搜索框搜索指定的内容
- `-dha` 禁用硬件加速启动(Disable Hardware Acceleration)
- `-dt` 以非透明模式启动(Disable Transparent)
- `-dhmkh` 禁用硬件媒体密钥处理(Disable Hardware Media Key Handling)

启动参数的详细说明请看[常见问题](https://github.com/lyswhut/lx-music-desktop/blob/master/FAQ.md#%E5%90%AF%E5%8A%A8%E5%8F%82%E6%95%B0)

#### 数据存储路径

默认情况下,软件的数据存储在:

- Windows:`%APPDATA%/lx-music-desktop`
- Linux:`$XDG_CONFIG_HOME/lx-music-desktop``~/.config/lx-music-desktop`
- macOS:`~/Library/Application/lx-music-desktop`

在Windows平台下,若程序目录下存在`portable`目录,则自动使用此目录作为数据存储目录(v1.17.0新增)。

### 源码使用方法

环境要求:Node.js 14+
Expand All @@ -76,22 +105,6 @@ npm run pack:linux

<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>

### 启动参数

目前软件已支持的启动参数如下:

- `-search` 启动软件时自动在搜索框搜索指定的内容,例如:`-search="突然的自我 - 伍佰"`
- `-dha` 禁用硬件加速启动(Disable Hardware Acceleration),窗口显示有问题时可以尝试添加此参数启动(v1.6.0起新增)
- `-dt` 以非透明模式启动(Disable Transparent),对于未开启AERO效果的win7系统可加此参数启动以确保界面正常显示(注:该参数对桌面歌词无效),原来的`-nt`参数已重命名为`-dt`(v1.6.0起重命名)
- `-dhmkh` 禁用硬件媒体密钥处理(Disable Hardware Media Key Handling),此选项将禁用Chromium的Hardware Media Key Handling特性(v1.9.0起新增)
- `-play` 启动时播放指定列表的音乐,参数说明:
- `type`:播放类型,目前固定为`songList`
- `source`:播放源,可用值为`kw/kg/tx/wy/mg/myList`,其中`kw/kg/tx/wy/mg`对应各源的在线列表,`myList`为本地列表
- `link`:要播放的在线列表歌单链接、或ID,source为`kw/kg/tx/wy/mg`之一(在线列表)时必传,举例:`./lx-music-desktop -play="type=songList&source=kw&link=歌单URL or ID"`,注意:如果传入URL时必须对URL进行编码后再传入
- `name`:要播放的本地列表歌单名字,source为`myList`时必传,举例:`./lx-music-desktop -play="type=songList&source=myList&name=默认列表"`
- `index`:从列表的哪个位置开始播放,选传,若不传默认播放第一首歌曲,举例:`./lx-music-desktop -play="type=songList&source=myList&name=默认列表&index=2"`


### 常见问题

常见问题已移至:<https://github.com/lyswhut/lx-music-desktop/blob/master/FAQ.md>
Expand Down
3 changes: 3 additions & 0 deletions build-config/main/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ module.exports = merge(baseConfig, {
},
}),
],
optimization: {
minimize: false,
},
})
1 change: 1 addition & 0 deletions build-config/renderer-lyric/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ module.exports = {
}),
new ESLintPlugin({
extensions: ['js', 'vue'],
formatter: require('eslint-formatter-friendly'),
}),
],
}
1 change: 0 additions & 1 deletion build-config/renderer-lyric/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = merge(baseConfig, {
mode: 'development',
devtool: 'eval-source-map',
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"development"',
Expand Down
1 change: 1 addition & 0 deletions build-config/renderer-lyric/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module.exports = merge(baseConfig, {
}),
],
optimization: {
minimize: false,
minimizer: [
new TerserPlugin(),
new CssMinimizerPlugin(),
Expand Down
1 change: 1 addition & 0 deletions build-config/renderer/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ module.exports = {
}),
new ESLintPlugin({
extensions: ['js', 'vue'],
formatter: require('eslint-formatter-friendly'),
}),
],
}
1 change: 0 additions & 1 deletion build-config/renderer/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = merge(baseConfig, {
mode: 'development',
devtool: 'eval-source-map',
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"development"',
Expand Down
83 changes: 43 additions & 40 deletions build-config/runner-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,26 @@ function startRenderer() {
// // logStats('Renderer', stats)
// })

const server = new WebpackDevServer(
compiler,
{
contentBase: path.join(__dirname, '../'),
quiet: true,
hot: true,
historyApiFallback: true,
clientLogLevel: 'warning',
overlay: {
errors: true,
},
before(app, ctx) {
app.use(hotMiddlewareRenderer)
ctx.middleware.waitUntilValid(() => {
resolve()
})
},
const server = new WebpackDevServer({
port: 9080,
hot: true,
historyApiFallback: true,
// static: {
// directory: path.join(__dirname, '../'),
// },
client: {
logging: 'warn',
overlay: true,
},
)
setupMiddlewares(middlewares, devServer) {
devServer.app.use(hotMiddlewareRenderer)
devServer.middleware.waitUntilValid(resolve)

server.listen(9080)
return middlewares
},
}, compiler)

server.start()
})
}

Expand All @@ -90,27 +89,25 @@ function startRendererLyric() {
// // logStats('Renderer', stats)
// })

const server = new WebpackDevServer(
compiler,
{
contentBase: path.join(__dirname, '../'),
quiet: true,
hot: true,
historyApiFallback: true,
clientLogLevel: 'warning',
overlay: {
errors: true,
},
before(app, ctx) {
app.use(hotMiddlewareRendererLyric)
ctx.middleware.waitUntilValid(() => {
resolve()
})
},
const server = new WebpackDevServer({
port: 9081,
hot: true,
historyApiFallback: true,
// static: {
// directory: path.join(__dirname, '../'),
// },
client: {
logging: 'warn',
overlay: true,
},
setupMiddlewares(middlewares, devServer) {
devServer.app.use(hotMiddlewareRenderer)
devServer.middleware.waitUntilValid(resolve)
return middlewares
},
)
}, compiler)

server.listen(9081)
server.start()
})
}

Expand Down Expand Up @@ -202,8 +199,14 @@ function init() {
}

Promise.all([
startRenderer().then(() => handleSuccess('renderer')).catch(() => handleFail('renderer')),
startRendererLyric().then(() => handleSuccess('renderer-lyric')).catch(() => handleFail('renderer-lyric')),
startRenderer().then(() => handleSuccess('renderer')).catch((err) => {
console.error(err.message)
return handleFail('renderer')
}),
startRendererLyric().then(() => handleSuccess('renderer-lyric')).catch((err) => {
console.error(err.message)
return handleFail('renderer-lyric')
}),
startMain().then(() => handleSuccess('main')).catch(() => handleFail('main')),
]).then(startElectron).catch(err => {
console.error(err)
Expand Down
Loading

0 comments on commit 0580b05

Please sign in to comment.