mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/lyswhut/lx-music-desktop.git
synced 2026-09-20 16:14:05 +08:00
Compare commits
2 Commits
api-source
...
v1.15.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
399cd6c694 | ||
|
|
a245c70b09 |
17
.babelrc
17
.babelrc
@@ -1,21 +1,20 @@
|
||||
{
|
||||
"presets": [
|
||||
"@babel/preset-typescript",
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"corejs": "3",
|
||||
"useBuiltIns": "usage"
|
||||
}
|
||||
],
|
||||
[
|
||||
"minify",
|
||||
{
|
||||
"builtIns": false,
|
||||
"evaluate": false,
|
||||
"mangle": false
|
||||
}
|
||||
]
|
||||
// [
|
||||
// "minify",
|
||||
// {
|
||||
// "builtIns": false,
|
||||
// "evaluate": false,
|
||||
// "mangle": false
|
||||
// }
|
||||
// ]
|
||||
],
|
||||
"plugins": [
|
||||
"@babel/plugin-syntax-dynamic-import",
|
||||
|
||||
104
.eslintrc
104
.eslintrc
@@ -1,15 +1,9 @@
|
||||
{
|
||||
"root": true,
|
||||
"extends": [
|
||||
"standard"
|
||||
],
|
||||
"extends": "standard",
|
||||
"plugins": [
|
||||
"html"
|
||||
],
|
||||
"parser": "@babel/eslint-parser",
|
||||
"parserOptions": {
|
||||
// "requireConfigFile": false
|
||||
},
|
||||
"parser": "babel-eslint",
|
||||
"rules": {
|
||||
"no-new": "off",
|
||||
"camelcase": "off",
|
||||
@@ -26,94 +20,8 @@
|
||||
"no-labels": "off",
|
||||
"node/no-callback-literal": "off"
|
||||
},
|
||||
"ignorePatterns": ["vendors", "*.min.js", "dist"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": [ "*.vue" ],
|
||||
"rules": {
|
||||
"no-new": "off",
|
||||
"camelcase": "off",
|
||||
"no-return-assign": "off",
|
||||
"space-before-function-paren": ["error", "never"],
|
||||
"no-var": "error",
|
||||
"no-fallthrough": "off",
|
||||
"prefer-promise-reject-errors": "off",
|
||||
"eqeqeq": "off",
|
||||
"no-multiple-empty-lines": [1, {"max": 2}],
|
||||
"comma-dangle": [2, "always-multiline"],
|
||||
"standard/no-callback-literal": "off",
|
||||
"prefer-const": "off",
|
||||
"no-labels": "off",
|
||||
"node/no-callback-literal": "off",
|
||||
"vue/multi-word-component-names": "off",
|
||||
"@typescript-eslint/strict-boolean-expressions": "off",
|
||||
"@typescript-eslint/explicit-function-return-type": "off",
|
||||
"@typescript-eslint/space-before-function-paren": "off",
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"@typescript-eslint/naming-convention": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"vue/max-attributes-per-line": "off",
|
||||
"vue/singleline-html-element-content-newline": "off",
|
||||
"vue/use-v-on-exact": "off",
|
||||
"@typescript-eslint/restrict-template-expressions": "off",
|
||||
// "no-undef": "off"
|
||||
},
|
||||
"parser": "vue-eslint-parser",
|
||||
"extends": [
|
||||
"plugin:vue/base",
|
||||
// "plugin:vue/strongly-recommended"
|
||||
"plugin:vue/vue3-recommended",
|
||||
"standard-with-typescript",
|
||||
],
|
||||
"parserOptions": {
|
||||
"sourceType": "module",
|
||||
"parser": {
|
||||
// Script parser for `<script>`
|
||||
"js": "@typescript-eslint/parser",
|
||||
|
||||
// Script parser for `<script lang="ts">`
|
||||
"ts": "@typescript-eslint/parser"
|
||||
},
|
||||
"extraFileExtensions": [".vue"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [ "*.ts" ],
|
||||
"rules": {
|
||||
"no-new": "off",
|
||||
"camelcase": "off",
|
||||
"no-return-assign": "off",
|
||||
"space-before-function-paren": ["error", "never"],
|
||||
"no-var": "error",
|
||||
"no-fallthrough": "off",
|
||||
"prefer-promise-reject-errors": "off",
|
||||
"eqeqeq": "off",
|
||||
"no-multiple-empty-lines": [1, {"max": 2}],
|
||||
"comma-dangle": [2, "always-multiline"],
|
||||
"standard/no-callback-literal": "off",
|
||||
"prefer-const": "off",
|
||||
"no-labels": "off",
|
||||
"node/no-callback-literal": "off",
|
||||
"@typescript-eslint/strict-boolean-expressions": "off",
|
||||
"@typescript-eslint/explicit-function-return-type": "off",
|
||||
"@typescript-eslint/space-before-function-paren": "off",
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"@typescript-eslint/restrict-template-expressions": [1, {
|
||||
"allowBoolean": true
|
||||
}],
|
||||
"@typescript-eslint/naming-convention": "off",
|
||||
"@typescript-eslint/return-await": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"multiline-ternary": "off",
|
||||
"@typescript-eslint/comma-dangle": "off",
|
||||
},
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"extends": [
|
||||
"standard-with-typescript"
|
||||
],
|
||||
"parserOptions": {
|
||||
"project": "./src/**/tsconfig.json"
|
||||
}
|
||||
}
|
||||
]
|
||||
"settings": {
|
||||
"html/html-extensions": [".html", ".vue"]
|
||||
},
|
||||
"ignorePatterns": ["vendors", "*.min.js"]
|
||||
}
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/----.yml
vendored
2
.github/ISSUE_TEMPLATE/----.yml
vendored
@@ -8,7 +8,7 @@ body:
|
||||
label: 解决方案检查
|
||||
description: 请确保你已完成以下所有操作
|
||||
options:
|
||||
- label: 我已阅读常见问题(<https://lyswhut.github.io/lx-music-doc/desktop/faq>),但没有找到解决方案
|
||||
- label: 我已阅读常见问题(<https://github.com/lyswhut/lx-music-desktop/blob/master/FAQ.md>),但没有找到解决方案
|
||||
required: true
|
||||
- label: 我已搜索issue列表(<https://github.com/lyswhut/lx-music-desktop/issues?utf8=✓&q=>),但没有发现类似的问题
|
||||
required: true
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/--bug.yml
vendored
2
.github/ISSUE_TEMPLATE/--bug.yml
vendored
@@ -8,7 +8,7 @@ body:
|
||||
label: 解决方案检查
|
||||
description: 请确保你已完成以下所有操作
|
||||
options:
|
||||
- label: 我已阅读常见问题(<https://lyswhut.github.io/lx-music-doc/desktop/faq>),并没有找到解决方案
|
||||
- label: 我已阅读常见问题(<https://github.com/lyswhut/lx-music-desktop/blob/master/FAQ.md>),并没有找到解决方案
|
||||
required: true
|
||||
- label: 我已搜索issue列表(<https://github.com/lyswhut/lx-music-desktop/issues?utf8=✓&q=>),并没有发现类似的问题
|
||||
required: true
|
||||
|
||||
128
.github/workflows/beta-pack.yml
vendored
128
.github/workflows/beta-pack.yml
vendored
@@ -11,15 +11,15 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Check out git repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: '14.x'
|
||||
|
||||
- name: Cache file
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
@@ -31,8 +31,7 @@ jobs:
|
||||
${{ runner.os }}-build-
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
npm ci
|
||||
run: npm install
|
||||
|
||||
- name: Build src code
|
||||
run: npm run build:src
|
||||
@@ -40,78 +39,73 @@ jobs:
|
||||
- name: Build Package Setup x64
|
||||
run: npm run pack:win:setup:x64
|
||||
- name: Upload Artifact Setup x64
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-x64-Setup
|
||||
path: build/* x64 Setup.exe
|
||||
|
||||
- name: Build Package 7z x64
|
||||
run: npm run pack:win:7z:x64
|
||||
- name: Upload Artifact 7z x64
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: lx-music-desktop-win_x64-green
|
||||
path: build/*win_x64 green.7z
|
||||
|
||||
- name: Build Package Setup x86
|
||||
run: npm run pack:win:setup:x86
|
||||
- name: Upload Artifact Setup x86
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-x86-Setup
|
||||
path: build/* x86 Setup.exe
|
||||
|
||||
- name: Build Package 7z x86
|
||||
run: npm run pack:win:7z:x86
|
||||
- name: Upload Artifact 7z x86
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: lx-music-desktop-win_x86-green
|
||||
path: build/*win_x86 green.7z
|
||||
|
||||
- name: Build Package Setup arm64
|
||||
run: npm run pack:win:setup:arm64
|
||||
- name: Upload Artifact Setup arm64
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-arm64-Setup
|
||||
path: build/* arm64 Setup.exe
|
||||
|
||||
- name: Build Package 7z arm64
|
||||
run: npm run pack:win:7z:arm64
|
||||
- name: Upload Artifact 7z arm64
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: lx-music-desktop-win_arm64-green
|
||||
path: build/*win_arm64 green.7z
|
||||
|
||||
- name: Build Package Setup x86_64
|
||||
run: npm run pack:win:setup:x86_64
|
||||
- name: Upload Artifact Setup x86_64
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-x86_64-Setup
|
||||
path: build/*x86_64 Setup.exe
|
||||
|
||||
- name: Generate file MD5
|
||||
run: |
|
||||
cd build
|
||||
Get-FileHash *.exe,*.7z -Algorithm MD5 | Format-List
|
||||
- name: Build Package 7z x64
|
||||
run: npm run pack:win:7z:x64
|
||||
- name: Upload Artifact 7z x64
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-win_x64-green
|
||||
path: build/*win_x64 green.7z
|
||||
|
||||
- name: Build Package 7z x86
|
||||
run: npm run pack:win:7z:x86
|
||||
- name: Upload Artifact 7z x86
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-win_x86-green
|
||||
path: build/*win_x86 green.7z
|
||||
|
||||
- name: Build Package 7z arm64
|
||||
run: npm run pack:win:7z:arm64
|
||||
- name: Upload Artifact 7z arm64
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-win_arm64-green
|
||||
path: build/*win_arm64 green.7z
|
||||
|
||||
Mac:
|
||||
name: Mac
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Check out git repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: '14.x'
|
||||
|
||||
- name: Cache file
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
@@ -123,8 +117,7 @@ jobs:
|
||||
${{ runner.os }}-build-
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
npm ci
|
||||
run: npm install
|
||||
|
||||
- name: Build src code
|
||||
run: npm run build:src
|
||||
@@ -138,40 +131,35 @@ jobs:
|
||||
ELECTRON_BUILDERCACHE: $HOME/.cache/electron-builder
|
||||
|
||||
- name: Upload Artifact dmg
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-mac-dmg
|
||||
path: |
|
||||
build/*.dmg
|
||||
!build/*-arm64.dmg
|
||||
- name: Upload Artifact dmg
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-mac-dmg-arm64
|
||||
path: build/*-arm64.dmg
|
||||
|
||||
- name: Generate file MD5
|
||||
run: |
|
||||
cd build
|
||||
md5 *.dmg
|
||||
|
||||
Linux:
|
||||
name: Linux
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install package
|
||||
run: sudo apt-get update && sudo apt-get install -y rpm libarchive-tools
|
||||
run: sudo apt-get install -y rpm libarchive-tools
|
||||
|
||||
- name: Check out git repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: '14.x'
|
||||
|
||||
- name: Cache file
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
@@ -183,8 +171,7 @@ jobs:
|
||||
${{ runner.os }}-build-
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
npm ci
|
||||
run: npm install
|
||||
|
||||
- name: Build src code
|
||||
run: npm run build:src
|
||||
@@ -192,15 +179,23 @@ jobs:
|
||||
- name: Build Package deb x64
|
||||
run: npm run pack:linux:deb:x64
|
||||
- name: Upload Artifact deb x64
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-deb-x64
|
||||
path: build/* x64.deb
|
||||
|
||||
- name: Build Package deb x86
|
||||
run: npm run pack:linux:deb:x86
|
||||
- name: Upload Artifact deb x86
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-deb-x86
|
||||
path: build/* x86.deb
|
||||
|
||||
- name: Build Package deb arm64
|
||||
run: npm run pack:linux:deb:arm64
|
||||
- name: Upload Artifact deb arm64
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-deb-arm64
|
||||
path: build/* arm64.deb
|
||||
@@ -208,7 +203,7 @@ jobs:
|
||||
- name: Build Package deb armv7l
|
||||
run: npm run pack:linux:deb:armv7l
|
||||
- name: Upload Artifact deb armv7l
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-deb-armv7l
|
||||
path: build/* armv7l.deb
|
||||
@@ -216,7 +211,7 @@ jobs:
|
||||
- name: Build Package x64 appImage
|
||||
run: npm run pack:linux:appImage
|
||||
- name: Upload Artifact x64 appImage
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-x64-appImage
|
||||
path: build/* x64.AppImage
|
||||
@@ -224,7 +219,7 @@ jobs:
|
||||
- name: Build Package x64 rpm
|
||||
run: npm run pack:linux:rpm
|
||||
- name: Upload Artifact x64 rpm
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-x64-rpm
|
||||
path: build/* x64.rpm
|
||||
@@ -232,12 +227,7 @@ jobs:
|
||||
- name: Build Package x64 pacman
|
||||
run: npm run pack:linux:pacman
|
||||
- name: Upload Artifact x64 pacman
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: lx-music-desktop-x64-pacman
|
||||
path: build/* x64.pacman
|
||||
|
||||
- name: Generate file MD5
|
||||
run: |
|
||||
cd build
|
||||
md5sum *.deb *.rpm *.pacman *.AppImage
|
||||
|
||||
57
.github/workflows/release.yml
vendored
57
.github/workflows/release.yml
vendored
@@ -11,15 +11,15 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Check out git repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: '14.x'
|
||||
|
||||
- name: Cache file
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
@@ -31,8 +31,7 @@ jobs:
|
||||
${{ runner.os }}-build-
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
npm ci
|
||||
run: npm install
|
||||
|
||||
- name: Build src code
|
||||
run: npm run build:src
|
||||
@@ -40,35 +39,30 @@ jobs:
|
||||
- name: Release package
|
||||
run: |
|
||||
npm run publish:win:setup:x64:always
|
||||
npm run publish:win:7z:x64
|
||||
npm run publish:win:setup:x86
|
||||
npm run publish:win:7z:x86
|
||||
npm run publish:win:setup:arm64
|
||||
npm run publish:win:7z:arm64
|
||||
npm run publish:win:setup:x86_64
|
||||
npm run publish:win:7z:x64
|
||||
npm run publish:win:7z:x86
|
||||
npm run publish:win:7z:arm64
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BT_TOKEN: ${{ secrets.BT_TOKEN }}
|
||||
|
||||
- name: Generate file MD5
|
||||
run: |
|
||||
cd build
|
||||
Get-FileHash *.exe,*.7z -Algorithm MD5 | Format-List
|
||||
|
||||
Mac:
|
||||
name: Mac
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Check out git repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: '14.x'
|
||||
|
||||
- name: Cache file
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
@@ -80,8 +74,7 @@ jobs:
|
||||
${{ runner.os }}-build-
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
npm ci
|
||||
run: npm install
|
||||
|
||||
- name: Build src code
|
||||
run: npm run build:src
|
||||
@@ -96,28 +89,23 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BT_TOKEN: ${{ secrets.BT_TOKEN }}
|
||||
|
||||
- name: Generate file MD5
|
||||
run: |
|
||||
cd build
|
||||
md5 *.dmg
|
||||
|
||||
Linux:
|
||||
name: Linux
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install package
|
||||
run: sudo apt-get update && sudo apt-get install -y rpm libarchive-tools
|
||||
run: sudo apt-get install -y rpm libarchive-tools
|
||||
|
||||
- name: Check out git repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: '14.x'
|
||||
|
||||
- name: Cache file
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
@@ -129,8 +117,7 @@ jobs:
|
||||
${{ runner.os }}-build-
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
npm ci
|
||||
run: npm install
|
||||
|
||||
- name: Build src code
|
||||
run: npm run build:src
|
||||
@@ -138,6 +125,7 @@ jobs:
|
||||
- name: Release package
|
||||
run: |
|
||||
npm run publish:linux:deb:x64:always
|
||||
npm run publish:linux:deb:x86
|
||||
npm run publish:linux:deb:arm64
|
||||
npm run publish:linux:deb:armv7l
|
||||
npm run publish:linux:appImage
|
||||
@@ -146,8 +134,3 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BT_TOKEN: ${{ secrets.BT_TOKEN }}
|
||||
|
||||
- name: Generate file MD5
|
||||
run: |
|
||||
cd build
|
||||
md5sum *.deb *.rpm *.pacman *.AppImage
|
||||
|
||||
20
.ncurc.js
20
.ncurc.js
@@ -1,19 +1,9 @@
|
||||
module.exports = {
|
||||
upgrade: true,
|
||||
reject: [
|
||||
'electron',
|
||||
'chalk',
|
||||
'del',
|
||||
'comlink',
|
||||
],
|
||||
// target: 'newest',
|
||||
// filter: [
|
||||
// 'electron-builder',
|
||||
// 'electron-updater',
|
||||
// ],
|
||||
|
||||
// target: 'minor',
|
||||
// filter: [
|
||||
// 'electron',
|
||||
// ],
|
||||
'vue-loader',
|
||||
'webpack-dev-server',
|
||||
'eslint',
|
||||
// 'eslint-config-standard'
|
||||
]
|
||||
}
|
||||
|
||||
29
.vscode/i18n-ally-custom-framework.yml
vendored
29
.vscode/i18n-ally-custom-framework.yml
vendored
@@ -1,29 +0,0 @@
|
||||
# .vscode/i18n-ally-custom-framework.yml
|
||||
|
||||
# An array of strings which contain Language Ids defined by VS Code
|
||||
# You can check avaliable language ids here: https://code.visualstudio.com/docs/languages/overview#_language-id
|
||||
languageIds:
|
||||
- javascript
|
||||
- typescript
|
||||
- vue
|
||||
|
||||
# An array of RegExes to find the key usage. **The key should be captured in the first match group**.
|
||||
# You should unescape RegEx strings in order to fit in the YAML file
|
||||
# To help with this, you can use https://www.freeformatter.com/json-escape.html
|
||||
usageMatchRegex:
|
||||
# The following example shows how to detect `t("your.i18n.keys")`
|
||||
# the `{key}` will be placed by a proper keypath matching regex,
|
||||
# you can ignore it and use your own matching rules as well
|
||||
- "[^\\w\\d]t\\(['\"`]({key})['\"`]"
|
||||
|
||||
|
||||
# An array of strings containing refactor templates.
|
||||
# The "$1" will be replaced by the keypath specified.
|
||||
# Optional: uncomment the following two lines to use
|
||||
|
||||
# refactorTemplates:
|
||||
# - i18n.get("$1")
|
||||
|
||||
|
||||
# If set to true, only enables this custom framework (will disable all built-in frameworks)
|
||||
monopoly: true
|
||||
37
.vscode/javascript.code-snippets
vendored
37
.vscode/javascript.code-snippets
vendored
@@ -1,37 +0,0 @@
|
||||
{
|
||||
// Place your lx-music-desktop-new 工作区 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
|
||||
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
|
||||
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
|
||||
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
|
||||
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
|
||||
// Placeholders with the same ids are connected.
|
||||
// Example:
|
||||
// "Print to console": {
|
||||
// "scope": "javascript,typescript",
|
||||
// "prefix": "log",
|
||||
// "body": [
|
||||
// "console.log('$1');",
|
||||
// "$2"
|
||||
// ],
|
||||
// "description": "Log output to console"
|
||||
// }
|
||||
"use i18n": {
|
||||
"prefix": "ui18n",
|
||||
"body": [
|
||||
"import { useI18n } from '@renderer/plugins/i18n'",
|
||||
"${1:const t = useI18n()}"
|
||||
]
|
||||
},
|
||||
"list action": {
|
||||
"prefix": "listacion",
|
||||
"body": [
|
||||
"import { $1 } from '@renderer/store/list/action'",
|
||||
]
|
||||
},
|
||||
"import vue tools": {
|
||||
"prefix": "imvt",
|
||||
"body": [
|
||||
"import { $1 } from '@common/utils/vueTools'",
|
||||
]
|
||||
}
|
||||
}
|
||||
24
.vscode/settings.json
vendored
24
.vscode/settings.json
vendored
@@ -1,17 +1,19 @@
|
||||
{
|
||||
"path-intellisense.mappings": {
|
||||
"@main/*": "${workspaceFolder}/src/main/*",
|
||||
"@renderer/*": "${workspaceFolder}/src/renderer/*",
|
||||
"@lyric/*": "${workspaceFolder}/src/renderer-lyric/*",
|
||||
"@static/*": "${workspaceFolder}/src/static/*",
|
||||
"@common/*": "${workspaceFolder}/src/common/*",
|
||||
},
|
||||
"i18n-ally.localesPaths": [
|
||||
"src/lang"
|
||||
"src/renderer/lang"
|
||||
],
|
||||
// "i18n-ally.fullReloadOnChanged": true,
|
||||
"i18n-ally.keystyle": "nested",
|
||||
"i18n-ally.displayLanguage": "zh-cn",
|
||||
"i18n-ally.sourceLanguage": "zh-cn",
|
||||
"i18n-ally.translate.engines": [
|
||||
"google-cn",
|
||||
"google"
|
||||
],
|
||||
"i18n-ally.sortKeys": true,
|
||||
"javascript.preferences.importModuleSpecifier": "non-relative",
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"vue.codeActions.enabled": false
|
||||
"i18n-ally.namespace": true,
|
||||
"i18n-ally.translate.engines": ["google-cn", "google"],
|
||||
"i18n-ally.pathMatcher": "{locale}/{namespaces}.json",
|
||||
"i18n-ally.keystyle": "flat",
|
||||
"i18n-ally.sortKeys": true
|
||||
}
|
||||
|
||||
31
.vscode/typescript.code-snippets
vendored
31
.vscode/typescript.code-snippets
vendored
@@ -1,31 +0,0 @@
|
||||
{
|
||||
// Place your lx-music-desktop-new 工作区 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
|
||||
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
|
||||
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
|
||||
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
|
||||
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
|
||||
// Placeholders with the same ids are connected.
|
||||
// Example:
|
||||
// "Print to console": {
|
||||
// "scope": "javascript,typescript",
|
||||
// "prefix": "log",
|
||||
// "body": [
|
||||
// "console.log('$1');",
|
||||
// "$2"
|
||||
// ],
|
||||
// "description": "Log output to console"
|
||||
// }
|
||||
"use i18n": {
|
||||
"prefix": "ui18n",
|
||||
"body": [
|
||||
"import { useI18n } from '@renderer/plugins/i18n'",
|
||||
"${1:const t = useI18n()}"
|
||||
]
|
||||
},
|
||||
"import vue tools": {
|
||||
"prefix": "imvt",
|
||||
"body": [
|
||||
"import { $1 } from '@common/utils/vueTools'",
|
||||
]
|
||||
}
|
||||
}
|
||||
563
CHANGELOG.md
563
CHANGELOG.md
@@ -6,569 +6,18 @@ 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/).
|
||||
|
||||
## [2.2.2](https://github.com/lyswhut/lx-music-desktop/compare/v2.2.1...v2.2.2) - 2023-05-01
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复在低版本Linux amd64系统上无法启动的问题(glibc版本要求过高导致的,采用内置预编译二进制文件的方式解决)
|
||||
- 修复添加歌曲弹窗默认列表名字显示问题
|
||||
|
||||
## [2.2.1](https://github.com/lyswhut/lx-music-desktop/compare/v2.2.0...v2.2.1) - 2023-05-01
|
||||
|
||||
### 优化
|
||||
|
||||
- 优化对系统Media Session的支持,现在切歌不会再会导致信息丢失的问题了
|
||||
- 启用桌面歌词时,取消对歌词窗口的聚焦
|
||||
- 增加kg歌单歌曲flac24bit显示(@helloplhm-qwq)
|
||||
- 增加tx源热门评论图片显示(@Folltoshe)
|
||||
- 优化更新弹窗弹出时机
|
||||
- 优化搜索框背景配色,使其适应高透明主题
|
||||
- 支持wy热门评论翻页
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复启用全局快捷键时与Media Session注册冲突的问题,启用全局快捷键时,不再注册媒体控制快捷键
|
||||
- 修复mg搜索不显示时长的问题(@Folltoshe)
|
||||
- 修复mg评论加载失败的问题(@Folltoshe)
|
||||
- 修复对存在错误时间标签的歌词的解析
|
||||
|
||||
### 其他
|
||||
|
||||
- 自定义源API utils对象新增`zlib.inflate`与`zlib.deflate`方法,API版本更新到 v1.3.0
|
||||
- 更新kg、tx、wy等平台排行榜列表
|
||||
- 更新 electron 到 v22.3.7
|
||||
|
||||
## [2.2.0](https://github.com/lyswhut/lx-music-desktop/compare/v2.1.2...v2.2.0) - 2023-03-26
|
||||
|
||||
从v2.2.0起,我们发布了一个独立版的[数据同步服务](https://github.com/lyswhut/lx-music-sync-server#readme),如果你有服务器,可以将其部署到服务器上作为私人多端同步服务使用,详情看该项目说明
|
||||
|
||||
### 不兼容性变更说明
|
||||
|
||||
- 同步功能,从这个版本起,数据同步功能至少需要移动端v1.0.0的版本才能连接,连接的地址格式也略有改变,详情看[文档说明](https://lyswhut.github.io/lx-music-doc/desktop/faq/sync)
|
||||
|
||||
### 新增
|
||||
|
||||
- 重构数据同步功能,新增客户端模式
|
||||
- 新增全屏时自动关闭歌词设置,默认开启,可以去设置-桌面歌词设置更改
|
||||
- 新增设置-桌面歌词设置-重置窗口设置功能,点击时会重置桌面歌词窗口大小及位置
|
||||
- 新增设置-其他-列表数据清理功能,点击时会清空已创建的所有列表及所有收藏的歌曲
|
||||
|
||||
### 优化
|
||||
|
||||
- 支持wy源flac hires歌曲类型的显示
|
||||
- 快捷键调整音量时每次加减2%音量改为4%(#1220)
|
||||
- 音量、播放模式等设置弹出式按钮在鼠标移到按钮上时将自动弹出设置内容,保留点击切换显示/隐藏
|
||||
- 支持kg源搜索列表、排行榜flac hires歌曲类型的显示(#1231, #1238 By @helloplhm-qwq, @Folltoshe)
|
||||
- 播放速率的粒度调整为0.01,范围0.6-2.0x
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复同步连接的处理问题
|
||||
- 修复记住播放进度的情况下,使用Scheme URL打开应用播放的歌曲进度没有被重置的问题
|
||||
- 修复使用酷狗码无法打开某些类型的歌单的问题
|
||||
- 修复tx源某些歌单因为歌曲信息缺失导致打开失败的问题
|
||||
- 修复连续选择时的初始选择歌曲位置被意外改变的问题
|
||||
|
||||
### 其他
|
||||
|
||||
- 更新 Electron 到v22.3.4
|
||||
|
||||
## [2.1.2](https://github.com/lyswhut/lx-music-desktop/compare/v2.1.1...v2.1.2) - 2023-02-18
|
||||
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复处于最新版本时更新弹窗日志内容显示异常的问题
|
||||
- 修复更新到最新版本后的首次启动时的更新日志未显示的问题
|
||||
|
||||
## [2.1.1](https://github.com/lyswhut/lx-music-desktop/compare/v2.1.0...v2.1.1) - 2023-02-18
|
||||
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复检查更新日志地址不正确的问题
|
||||
|
||||
## [2.1.0](https://github.com/lyswhut/lx-music-desktop/compare/v2.0.5...v2.1.0) - 2023-02-18
|
||||
|
||||
由于软件内功能在设计时只考虑简单便捷性,是否对新手友好并不是我们考虑的重点,功能的新增、变更会在更新日志中注明,不会在软件内做指引提示,
|
||||
因此为了更愉快地使用本软件,我们建议在使用新版本时阅读一遍更新日志以了解软件的变更情况,同时若遇到问题可以去阅读常见问题找解决方案
|
||||
|
||||
### 新增
|
||||
|
||||
- 新增桌面歌词设置字体加粗设置,可以到设置-桌面歌词设置-加粗字体修改
|
||||
- 新增是否自动下载更新设置,默认开启,可以去设置-软件更新更改
|
||||
- 新增当前版本更新日志显示弹窗(建议大家阅读更新日志以了解当前版本的变化),在更新版本后将自动弹出
|
||||
- 新增是否在更新版本的首次启动时显示更新日志弹窗设置,默认开启,可以去设置-软件更新更改
|
||||
- 新增播放速率调整功能,可以去播放详情页的控制按钮调整,范围限制为x0.5至x2之间(#13)
|
||||
- 添加wy、tx源(感谢某位不愿透露姓名的大佬提供的C++算法源码,但由于作者不希望公开,所以将会以预构建二进制文件的形式加入代码仓库中)逐字歌词的支持
|
||||
- 新增设置-下载设置-是否嵌入翻译歌词、罗马音歌词设置,默认关闭
|
||||
- 添加启动时的数据库表及表结构完整性校验,若未通过校验,则会显示弹窗提示后将该数据库重命名添加`.bak`后缀后重建数据库启动。对于某些人遇到更新到v2.0.0后出现之前收藏的歌曲全部丢失或者歌曲无法添加到列表的问题,可以通过此特性自动重建数据库并重新迁移数据,不再需要手动去数据目录删除数据库
|
||||
|
||||
### 优化
|
||||
|
||||
- 微调了桌面歌词逐行字体阴影,使其看起来更匀称
|
||||
- 调整了桌面歌词在启用滚动到顶部时的距离,现在滚动到顶部的歌词更靠边,不再受字体大小、歌词间距影响
|
||||
- 优化更新弹窗内容的显示,添加了自动更新失败时的更新指引
|
||||
- 为所有文本输入框添加右键快速粘贴的功能,右击输入框可以自动粘贴剪贴板的文字,若选中文字时将粘贴并替换选中文字
|
||||
- 防止桌面歌词窗口在屏幕分辨率变小时,窗口位置跟随分辨率变化的问题,现在若屏幕分辨率变小后窗口位置仍会在原始分辨率的位置(添加这个机制是为了解决屏幕分辨率被临时调整时的位置更新问题,如运行某些低分辨率的全屏游戏、高分辨率外接屏幕休眠时),但若你的分辨率调整不是临时的,因窗口在原始位置导致看不到窗口可以开关桌面歌词即可重新自动调节回屏幕内
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复播放下载列表的歌曲时,调整歌词偏移时间功能异常的问题
|
||||
- 修复较旧Linux arm64系统下无法启动软件的问题(将预构建模块的所需glibc版本降级到2.28)(#1161)
|
||||
- 修改列表响应式更新机制,尝试修复偶现的删除歌曲列表未更新的问题
|
||||
- 修复某些kg歌单链接无法打开的问题
|
||||
- 修复将桌面歌词放到屏幕边缘时,偶现的开启桌面歌词后出现歌词窗口位置出现少许偏移的问题,以及将歌词窗口调整到全屏大小后,重开桌面歌词窗口被缩小出现边距的问题
|
||||
|
||||
### 其他
|
||||
|
||||
- 更新Electron到v22.3.0
|
||||
|
||||
## [2.0.5](https://github.com/lyswhut/lx-music-desktop/compare/v2.0.4...v2.0.5) - 2023-01-18
|
||||
|
||||
这应该是LX今年的最后一个版本,提前祝大家新年快乐~😘
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复声音输出设备更改时后的自动暂停播放设置无效的问题
|
||||
- 重写桌面歌词窗口坐标的计算逻辑,修复桌面歌词移动到最边缘时,某些情况下在启用歌词后会出现窗口偏移的问题(远古bug了)
|
||||
- 修复随机播放模式下使用稍后播放功能播放我的列表的歌曲时,切换下一曲永远是当前歌曲的问题(#1147)
|
||||
- 修复macOS下的软件系统菜单中的退出功能不会完全退出软件的问题(#1148)
|
||||
|
||||
## [2.0.4](https://github.com/lyswhut/lx-music-desktop/compare/v2.0.3...v2.0.4) - 2023-01-15
|
||||
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复备份文件导入指引无法识别v2配置的问题
|
||||
- 修复从搜索界面进入歌单详情后,若启用强迫症设置的清空功能会导致意外清空搜索框、搜索列表的问题
|
||||
- 修复桌面歌词在启用卡拉OK歌词后字体边缘可能被截断的问题(特别是纵向歌词某些字的边角被截断导致后面的阴影露出来或阴影不均匀的问题)
|
||||
- 修复桌面歌词启用歌词缩放后的阴影显示问题
|
||||
- 修复Linux armv7l系统(如树莓派)下无法启动的问题(与修复Linux arm64的方法一样采用内置预编译模块的方式修复)
|
||||
- 修复备份与恢复的列表导入列表信息设置逻辑问题与潜在导入问题
|
||||
|
||||
## [2.0.3](https://github.com/lyswhut/lx-music-desktop/compare/v2.0.2...v2.0.3) - 2023-01-08
|
||||
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复初始设置的桌面歌词窗口没有完全居右下角的问题
|
||||
- 修复Linux arm64系统下无法启动的问题(#1102)
|
||||
- 修复桌面歌词使用斜体出现截断的问题(#1106)
|
||||
- 修复某些情况下歌词的滚动问题
|
||||
- 修复禁用切歌时歌曲播放完毕后的歌曲信息显示问题
|
||||
- 修复修改播放设置-音频输出设置后,所做的更改没有被保存的问题
|
||||
|
||||
### 优化
|
||||
|
||||
- 点击打开歌单弹窗背景可以关闭弹窗(#1096)
|
||||
|
||||
## [2.0.2](https://github.com/lyswhut/lx-music-desktop/compare/v2.0.1...v2.0.2) - 2023-01-02
|
||||
|
||||
若你更新v2.0.0后,出现之前收藏的歌曲全部丢失或者歌曲无法添加到列表播放的问题,可以按以下方式解决:
|
||||
|
||||
1. 根据你的平台类型,进入软件数据目录
|
||||
- Windows:`%APPDATA%/lx-music-desktop`
|
||||
- Linux:`$XDG_CONFIG_HOME/lx-music-desktop` 或 `~/.config/lx-music-desktop`
|
||||
- macOS:`~/Library/Application Support/lx-music-desktop`
|
||||
|
||||
2. 进入`LxDatas`目录,退出LX,删除`lx.data.db`文件,再启动软件即可
|
||||
|
||||
若以上操作仍然不行,可以加交流群或者在GitHub开issue反馈
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复无效的歌曲信息导致我的列表数据迁移失败的问题
|
||||
|
||||
## [2.0.1](https://github.com/lyswhut/lx-music-desktop/compare/v2.0.0...v2.0.1) - 2023-01-02
|
||||
|
||||
若你更新v2.0.0后,出现之前收藏的歌曲全部丢失或者歌曲无法添加到列表播放的问题,可以按以下方式解决:
|
||||
|
||||
1. 根据你的平台类型,进入软件数据目录
|
||||
- Windows:`%APPDATA%/lx-music-desktop`
|
||||
- Linux:`$XDG_CONFIG_HOME/lx-music-desktop` 或 `~/.config/lx-music-desktop`
|
||||
- macOS:`~/Library/Application Support/lx-music-desktop`
|
||||
|
||||
2. 进入`LxDatas`目录,退出LX,删除`lx.data.db`文件,再启动软件即可
|
||||
|
||||
若以上操作仍然不行,可以加交流群或者在GitHub开issue反馈
|
||||
|
||||
### 优化
|
||||
|
||||
- 单次执行所有sql语句,尝试解决某些情况下某些表没有成功创建的问题
|
||||
|
||||
## [2.0.0](https://github.com/lyswhut/lx-music-desktop/compare/v1.22.3...v2.0.0) - 2023-01-01
|
||||
|
||||
|
||||
### 不兼容性变更说明
|
||||
|
||||
- 数据迁移,升级此版本时,会使用旧版本的我的列表、下载设置、快捷键设置、自定义源等数据会自动迁移到新的数据格式版本,旧的数据仍然会保留,但下载列表的数据不做迁移
|
||||
- 备份文件,v2.0.0及以后版本导出的列表、配置不支持导入v2.0.0之前版本,但v2.0.0之前版本导出的列表、配置支持导入v2.0.0以及以后版本(移动端需v0.15.0起才支持导入PC端v2生成的备份数据)
|
||||
- 同步功能,该功能不支持与移动端v1.0.0之前版本的使用,需等待后面的新版移动端,目前移动端v1的开发工作已在进行中
|
||||
|
||||
### 新增
|
||||
|
||||
- 新增自定义主题功能
|
||||
- 新增歌单搜索功能
|
||||
- 新增将本地歌曲添加到我的列表的支持,此功能可以在列表的右击菜单中使用(本地歌曲的歌词优先尝试读取相同路径下的同名歌词文件,若文件不存在则尝试读取歌曲文件内的歌词,若还是找不到歌词则尝试利用换源功能获取在线歌词,歌曲封面则是尝试读取歌曲文件内的封面,若不存在则利用换源功能获取在线封面)
|
||||
- 启动软件时自动回到上次的界面,例如上次退出软件时在我的列表,下次启动软件时会自动进入我的列表
|
||||
- 新增启动软件时自动播放音乐设置,默认关闭,可去设置-播放设置开启
|
||||
- 新增“蛋雅深藍”、“近墨者黑”皮肤
|
||||
- 新增下载歌词时是否同时下载歌词翻译、罗马音设置,默认关闭,可以去设置-下载设置开启(#344)
|
||||
- 新增下载时,若目录存在同名的文件时是否跳过下载此任务的设置(默认跳过,可以去设置-下载设置更改)
|
||||
- 新增界面字体大小设置
|
||||
- 桌面歌词新增竖排歌词显示功能(#971)
|
||||
- 桌面歌词新增歌词对齐方式、是否不允许歌词换行、歌词颜色、滚动对齐方式、歌词间距设置
|
||||
- 桌面歌词新增歌曲频谱显示(得益于主窗口与桌面歌词进程通信的改进,可以将此功能以CPU使用率“相对较低”的方式带到桌面歌词中)
|
||||
- 桌面歌词新增在任务栏显示歌词进程设置(此设置用于在录屏软件无法捕获歌词窗口时的变通解决方法)(#1063)
|
||||
- 添加kg源罗马音歌词的支持(感谢@helloplhm-qwq)
|
||||
- 支持打开波点音乐歌单(需在酷我源打开)
|
||||
- 新增设置-基本设置-播放栏进度条样式设置(此版本默认使用迷你进度条样式,对于某些不喜欢该样式的人可以将其换成其他样式)
|
||||
- 添加kg源评论图片展示(感谢@helloplhm-qwq)
|
||||
|
||||
### 优化(界面/交互/功能)
|
||||
|
||||
- 调整软件界面及配色,使其更加清爽
|
||||
- 处于单曲循环、顺序播放、禁用切歌模式时,手动切歌将会按列表循环模式的逻辑处理切歌(#864)
|
||||
- 歌单右键菜单的“重复歌曲”扫描功能现在会将歌曲名字内的括号内容移除再对比,这可以有效找出歌曲的变体,例如:`突然的自我`、`突然的自我(Live)`、`突然的自我(女生版)`、`突然的自我(DJ版)`等都会被找出来(#987)
|
||||
- 允许更小的桌面歌词窗口高度,可以取消“不允许拖动到主屏幕之外”设置后,再启用“不允许歌词换行”、“置顶歌词”与“自动刷新置顶”等设置,把它拖动到任务栏上,当做任务栏歌词使用(具体可以按你想要的显示方式使用这些设置组合去调)
|
||||
|
||||
### 优化(程序)
|
||||
|
||||
- 优化程序启动性能,优化与程序交互的流畅度
|
||||
- 重构整个程序,重新梳理了程序逻辑,使其更容易扩展及维护,将大部分代码从JavaScript迁移到TypeScript
|
||||
- 重写配置管理、列表管理功能,列表、歌词数据从json文件迁移到sqlite3存储,这应该能解决因为意外的字符编码导致的数据文件损坏问题
|
||||
|
||||
### 变更
|
||||
|
||||
- 列表右侧的操作按钮栏默认不再显示,歌曲的操作可以使用右键菜单代替,若想恢复它们的显示,可以去设置-列表设置-启用操作按钮栏开启
|
||||
- 窗口大小设置时不再自动调整字体大小,想要调整字体大小可以使用新增的字体大小设置调整
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复Linux、macOS下若程序路径存在百分号时会导致软件无法启动的问题(#963)
|
||||
- 支持单行多时间标签歌词解析,修复某些歌词会出现时间标签的问题
|
||||
|
||||
### 移除
|
||||
|
||||
- 移除“信口雌黄”皮肤(由于该皮肤的配色有点刺眼),若你正在使用该皮肤,可以使用自定义主题功能恢复它
|
||||
- 移除Linux deb x86包构建,Electron/Chromium已不再支持 32-bit Linux(electron/electron#34787)
|
||||
- 移除桌面歌词主题设置,改用桌面歌词字体颜色设置功能代替
|
||||
|
||||
### 其他
|
||||
|
||||
- 更新Electron到v19.1.9
|
||||
|
||||
## [1.22.3](https://github.com/lyswhut/lx-music-desktop/compare/v1.22.2...v1.22.3) - 2022-09-03
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复因音源的域名到期导致的音源失效的问题
|
||||
|
||||
## [1.22.2](https://github.com/lyswhut/lx-music-desktop/compare/v1.22.1...v1.22.2) - 2022-08-18
|
||||
|
||||
### 优化
|
||||
|
||||
- 为tx、kw源添加 Flac 24bit 音质显示,注:由于之前没有记录此音质,所以之前收藏的歌曲信息中不包含它
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复无法批量排序歌曲的问题
|
||||
- 修复某些缺失的繁体中文翻译
|
||||
- 修复企鹅音乐搜索失效的问题
|
||||
|
||||
### 其他
|
||||
|
||||
- 降级electron到v15.5.7
|
||||
|
||||
## [1.22.1](https://github.com/lyswhut/lx-music-desktop/compare/v1.22.0...v1.22.1) - 2022-07-09
|
||||
|
||||
### 优化
|
||||
|
||||
- 歌单列表添加歌单内歌曲数量显示,注:目前只有kw、mg、wy、tx(部分)源支持显示
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复处于不支持的源时,歌单、排行榜的右键下载菜单没有禁用的问题
|
||||
- 修复若桌面歌词窗口与主窗口重叠时,鼠标划过重叠区域鼠标会闪烁的问题,注:此修复只对未启用“鼠标移入歌词区域时降低歌词透明度”时有效
|
||||
- 修复tx源搜索失效的问题
|
||||
|
||||
### 其他
|
||||
|
||||
- 升级Electron到 v17.4.10
|
||||
|
||||
## [1.22.0](https://github.com/lyswhut/lx-music-desktop/compare/v1.21.0...v1.22.0) - 2022-06-19
|
||||
|
||||
### 新增
|
||||
|
||||
- 新增设置-以全屏模式启动设置
|
||||
- 新增设置-桌面歌词设置-鼠标移入歌词区域时降低歌词透明度(#883),默认关闭,此设置不支持linux,注:此功能存在兼容性问题,若鼠标移出后无法恢复到正常透明度,可尝试再移入移出即可恢复
|
||||
|
||||
### 优化
|
||||
|
||||
- 添加歌曲到“我的列表”时,若按住`ctrl`键(Mac对应`Command`),则不会自动关闭添加窗口,这对想要将同一首(一批)歌曲添加到多个列表时会很有用
|
||||
- 支持mg源逐字歌词的播放,感谢 @mozbugbox 提供的帮助
|
||||
- 添加歌曲列表更新操作的二次确认
|
||||
- 添加导入文件错误时的指引提示
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复若配置了`http_proxy`环境变量时,会意外使用此代理配置的问题
|
||||
- 修复多选后切换列表后不会清空多选内容的问题
|
||||
- 修复设置快捷键时的处理逻辑问题
|
||||
- 修复在新建歌单输入框、歌单内歌曲搜索输入框会意外触发设置的全局快捷键的问题(#879)
|
||||
|
||||
### 文档
|
||||
|
||||
桌面版文档已迁移到:<https://lyswhut.github.io/lx-music-doc/desktop>
|
||||
|
||||
### 其他
|
||||
|
||||
- 更新 Electron 到 v17.4.7
|
||||
|
||||
## [1.21.0](https://github.com/lyswhut/lx-music-desktop/compare/v1.20.0...v1.21.0) - 2022-05-22
|
||||
|
||||
### 新增
|
||||
|
||||
- 新增设置-播放设置-显示歌词罗马音,默认关闭,注:目前只有网易源能获取到罗马音歌词(得益于 Binaryify/NeteaseCloudMusicApi/pull/1523),如果你知道其他源的歌词罗马音获取方式,欢迎PR或开issue交流!
|
||||
|
||||
### 优化
|
||||
|
||||
- 同时删除一首歌以上时将需要二次确认删除
|
||||
- 禁用透明窗口时右侧不再偏移5px距离(在win7、Ubuntu等系统上测试发现不偏移也不影响滚动条的拖动了)
|
||||
- 删除未下载完成的任务时,只同时尝试删除已有下载进度的本地文件
|
||||
- 在全屏状态下使用`Esc`键可以退出全屏(#827)
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复某些情况下歌曲播放出错时不会自动切歌的问题
|
||||
- 修复关闭“显示切换动画”设置后,在应用启动时该设置没有被应用的问题
|
||||
- 修复原始歌词存在偏移时,歌词偏移设置的重置未按预期工作的问题
|
||||
- 修复长度大于一行的歌词在使用歌词调整播放进度时的时间不准问题
|
||||
- 修复潜在歌单更新失败的问题
|
||||
|
||||
### 文档
|
||||
|
||||
- 将歌曲添加“稍后播放”后,它们会被放在一个优先级最高的特殊队列中,点击“下一曲”时会消耗该队列中的歌曲,并且无法通过“上一曲”功能播放该队列的上一首歌曲
|
||||
- 在切歌时若不是通过“上一曲”、“下一曲”功能切歌(例如直接点击“排行榜列表”、“我的列表”中的歌曲切歌),“稍后播放”队列将会被清空
|
||||
|
||||
## [1.20.0](https://github.com/lyswhut/lx-music-desktop/compare/v1.19.0...v1.20.0) - 2022-04-17
|
||||
|
||||
特别说明:Scheme URL其实是支持Linux系统的,但好像需要deb之类的安装包创建出`.desktop`文件才行。
|
||||
|
||||
### 新增
|
||||
|
||||
- 新增播放详情页歌词右键菜单,原来设置-播放详情页设置的字体重置已迁移到此菜单内
|
||||
- 新增歌词偏移设置,可以在播放详情页歌词右键菜单中使用
|
||||
- 新增设置-播放设置-播放错误时自动切换歌曲设置,默认开启(原来的行为),若你不想在遇到音频加载失败、url获取失败等错误时自动切歌可以关闭此设置
|
||||
- 新增设置-桌面歌词设置-自动刷新歌词置顶(当歌词置顶后仍被某些程序遮挡时可尝试启用此设置)
|
||||
- 新增列表更新管理,可以在鼠标移入“我的列表”标题时出现的按钮中进入,这可以用来设置启动软件时需要自动从原平台更新的列表
|
||||
|
||||
### 优化
|
||||
|
||||
- 优化播放详情页背景显示,现在有背景图片的主题可以在播放详情页显示它的图片了
|
||||
- 播放详情页在全屏状态下仍会显示退出播放详情页按钮,同时在其旁边添加退出全屏按钮
|
||||
- 播放详情页在全屏状态下鼠标在空白处静止不动3秒后自动将其隐藏
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复Linux无法全屏的问题
|
||||
- 修复播放下载列表的歌曲时,使用Windows任务栏缩略图工具栏控制按钮的收藏按钮收藏歌曲时的异常问题
|
||||
- 修复启用搜索历史但不启用热门搜索时,搜索历史不显示的问题
|
||||
- 修复窗口尺寸设置对应的字体大小在启动后不生效的问题
|
||||
- 修复wy源搜索某些歌曲时第一页之后的歌曲无法加载的问题
|
||||
- 修复使用Scheme URL搜索歌曲时,不会自动关闭播放详情页(若处于打开状态)的问题
|
||||
- 修复换源失败时的处理问题
|
||||
- 修复启用代理时,https请求可能被挂起或被转为http的问题
|
||||
- 修复正在下载的歌曲暂停任务后,再开始会导致程序卡死的问题
|
||||
|
||||
### 变更
|
||||
|
||||
- 播放详情页的任意地方右键双击隐藏详情页的行为,“任意区域”改为在“非歌词区域”
|
||||
|
||||
### 移除
|
||||
|
||||
- 移除设置-播放详情页设置-歌词字体重置,此设置项已迁移到播放详情页的歌词菜单中
|
||||
- 移除播放详情页使用+-快捷键调整字体大小的功能,改用歌词右键菜单的字体大小调整功能
|
||||
|
||||
## [1.19.0](https://github.com/lyswhut/lx-music-desktop/compare/v1.18.0...v1.19.0) - 2022-03-20
|
||||
|
||||
### 新增
|
||||
|
||||
- 新增对播放详情页歌词大小、是否缩放、对齐方式的设置,可以去设置-播放详情页设置查看
|
||||
- 新增播放详情页通过歌词调整播放进度,默认关闭,需要到设置-播放详情页设置开启,开启后在播放详情页拖动歌词时将会出现跳转当前行歌词播放的按钮
|
||||
- 新增全屏状态,按F11可以进入、退出全屏状态,由于全屏时会隐藏控制栏按钮,所以需要使用鼠标右键双击(详情页的任意地方都可以)来关闭播放详情页
|
||||
- 新增动态主题“道法自然”,你可以预先设置一个亮色主题及暗色主题,此后将根据系统的亮、暗主题色自动切换为你预先设置的相应主题。注:鼠标 右击 此主题项即可打开亮、暗色主题设置窗口。
|
||||
- 新增对kw源卡拉OK歌词的支持
|
||||
|
||||
### 优化
|
||||
|
||||
- 优化Windows任务栏缩略图工具栏控制按钮在浅色任务栏下的显示效果
|
||||
- 添加音频可视化与音频输出设备冲突的提示
|
||||
- 优化歌词的播放偏移
|
||||
- 优化托盘菜单操作(#686)
|
||||
- 优化播放下载列表时的切歌性能
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复“当前的声音输出设备被改变时暂停播放歌曲”设置无效的问题
|
||||
- 修复桌面歌词没有处理停止播放状态的问题
|
||||
- 修复AppImage包无法运行的问题
|
||||
- 修复Windows任务栏缩略图工具栏控制按钮的歌曲收藏按钮状态更新问题
|
||||
- 修复使用链接导入的歌单无法在我的列表打开原歌单详情页的问题
|
||||
- 修复播放下载列表的歌曲时增删下载任务导致正在的歌曲序号改变时,不会更新到新增序号的问题
|
||||
|
||||
### 文档
|
||||
|
||||
添加LX中定义的快捷操作汇总说明到常见问题中,这是目前可用的鼠标、键盘快捷操作,它们都可以在更新日志中找到
|
||||
|
||||
- 鼠标右击播放栏的歌曲图片封面可以定位当前播放的歌曲
|
||||
- 鼠标右击播放栏进度条上的LRC按钮可以锁定/解锁桌面歌词
|
||||
- 歌曲搜索框、歌单链接输入框内鼠标右击可以将当前剪贴板上的文字粘贴到输入框内
|
||||
- 鼠标右击搜索界面中的单条搜索历史可以将其移除
|
||||
- 歌曲列表内的文字在选中后,鼠标右击可以复制已选中的文字,此功能只对搜索、歌单、排行榜、我的列表中的列表有效
|
||||
- 鼠标在播放详情页内右键双击可以关闭播放详情页
|
||||
- 鼠标左击播放栏上的歌曲名字可以将它复制
|
||||
- 鼠标右击“道法自然(英文Auto)”主题可以打开亮、暗主题设置窗口
|
||||
- 歌曲搜索框的候选内容可以用键盘上下方向键选择,按回车键搜索已选内容
|
||||
- 在歌单详情页按退格键可以返回歌单列表
|
||||
- 歌曲列表中可以使用Ctrl、Shift键进行多选,这类似Windows下的文件选择,详情看常见问题列表多选部分
|
||||
- 在我的列表内可以使用Ctrl+f键打开搜索框进行列表内歌曲搜索,搜索框按Esc键可以关闭搜索框,搜索框内按上下方向键可以选择歌曲,按回车键跳转到已选歌曲,按Ctrl+回车可以跳转并播放已选歌曲
|
||||
- 在我的列表按住Ctrl键可以进入列表拖动模式,此时可以用鼠标拖动列表调整列表的位置
|
||||
- 编辑列表名时按Esc键可以取消编辑
|
||||
- 按F11可以进入、退出全屏状态
|
||||
|
||||
## [1.18.0](https://github.com/lyswhut/lx-music-desktop/compare/v1.17.1...v1.18.0) - 2022-02-26
|
||||
|
||||
### 新增
|
||||
|
||||
- 新增“双击列表里的歌曲时自动切换到当前列表播放”设置,此功能仅对歌单、排行榜有效,默认关闭
|
||||
- 新增打开收藏的在线列表的对应平台详情页功能,可以在我的列表-列表右键菜单中使用
|
||||
- 新增定时暂停播放功能,由于此功能大多数人可能不常用,所以将其放在设置-基本设置中
|
||||
- 新增任务栏缩略图工具栏控制按钮(此功能仅在Windows平台可用),按钮分别为收藏/取消收藏(将歌曲添加到“我的收藏”列表)、上一曲、播放/暂停、下一曲
|
||||
- 新增设置-基本设置-软件字体设置,此设置可用于设置主界面的字体(已知的问题:Windows 7 下可能会出现字体列表为空的情况,这是当前系统的 Powershell 版本小于5.1导致的,请自行尝试看常见解决)
|
||||
- 新增Scheme URL对音乐搜索的调用支持,详情看常见问题-Scheme URL支持
|
||||
- 新增Scheme URL以url传参的方式调用,详情看常见问题-Scheme URL支持
|
||||
- 自定义源新增更新弹窗方法,同时自定义源管理新增是否允许源显示更新弹窗设置(出于防止滥用考虑),当源作者想要通知用户源已更新时,可以调用此方法弹窗告诉用户,调用说明看常见问题-自定义源部分
|
||||
|
||||
### 优化
|
||||
|
||||
- 过滤tx源某些不支持播放的歌曲,解决播放此类内容会导致意外的问题
|
||||
- 把歌曲的热门评论与最新评论拆分成两个列表显示
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复排行榜名字右击菜单的播放功能在播放非激活的列表时的列表获取问题
|
||||
- 修复修改列表名时无法使用`Ctrl`键的问题
|
||||
- 修复wy源某些歌曲获取歌词翻译的问题处理
|
||||
- 修复下载功能的歌词换源时会进入死循环的问题
|
||||
- 修复某些歌曲无法下载的问题
|
||||
- 修复windows平台下软件目录存在`portable`文件夹时,仍会创建`C:\Users\<user>\AppData\Roaming\lx-music-desktop\Dictionaries\en-US-9-0.bdic`文件的问题,现在不会再创建文件,但仍会创建空目录(Electron的问题,目前暂无解决方法)
|
||||
- 修复播放器的停止逻辑问题
|
||||
|
||||
### 其他
|
||||
|
||||
- 更新electron到v13.6.9
|
||||
|
||||
## [1.17.1](https://github.com/lyswhut/lx-music-desktop/compare/v1.17.0...v1.17.1) - 2022-01-28
|
||||
|
||||
### 优化
|
||||
|
||||
- 优化kw源英文与翻译歌词的匹配
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复快捷键与默认按键行为冲突的问题,现在若将某些有默认行为的按键(如在列表中上、下箭头、Home、End等键可以使列表滚动)设置为快捷键时,将禁用其默认行为
|
||||
- 修复列表的聚焦问题,现在在列表中使用上、下箭头、空格等键滚动列表时不会导致滚动到一定距离后丢失焦点的问题
|
||||
|
||||
### 其他
|
||||
|
||||
- 更新electron到v13.6.8
|
||||
|
||||
## [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
|
||||
|
||||
这算是一个大版本,对主窗口部分的代码逻辑做了较大改动,但由于界面的改动不大,所以没有更新大版本号。
|
||||
虽然经过一个月的测试与问题修复,但可能仍然存在未发现的问题,若你发现某些界面异常、某些行为与旧版本存在差异等问题,欢迎反馈!
|
||||
另外祝大家元旦快乐~!
|
||||
|
||||
### 新增
|
||||
|
||||
- 播放详情页新增音量控制条
|
||||
- 播放详情页新增桌面歌词切换按钮
|
||||
- 新增将我的列表保存为TXT、CSV格式,可以去设置-备份与恢复中使用(注意:此类格式的备份目前不支持恢复到LX Music中)
|
||||
- 新增根据歌曲名、歌手名等字段对列表自动排序的功能,可以在我的列表右击列表名弹出的菜单中使用
|
||||
- 新增将播放与下载的歌词转换为繁体中文选项,默认关闭,可在设置-播放设置中开启
|
||||
- 现在已允许进入临时播放列表,即:使用歌单详情页、排行榜名称右键菜单的“播放”按钮播放歌曲时,可右击播放封面进入此临时列表
|
||||
- 播放详情页新增音频可视化功能(实验性)
|
||||
- 我的列表新增拖动调整位置功能,按住Ctrl键(Mac上对应Command键)的时候将进入“拖动模式”,此时可以拖动列表的位置来调整顺序
|
||||
|
||||
### 优化
|
||||
|
||||
- 优化列表性能,软件整体性能
|
||||
- 调整Mac平台下的图标大小
|
||||
- 同步功能添加对列表顺序调整的控制,确保手动调整位置后的列表与不同的电脑同步时,列表位置不会被还原
|
||||
- 优化歌单详情、排行榜名右键的播放按钮的播放机制,现在不用等待整个列表(多页时)加载完成才能播放了
|
||||
- 为播放详情页、桌面歌词添加延迟滚动,播放详情页略微减小已激活歌词的缩放大小及桌面歌词翻译大小
|
||||
- 修改右边控制按钮为windows风格
|
||||
- 更新了新年皮肤的背景与配色,欢迎体验~
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复kw源某些歌曲的歌词提取异常的问题
|
||||
|
||||
### 变更
|
||||
|
||||
- 现在使用繁体中文语言时将不再自动转换歌词,转换行为将由上面新增的转换开关控制
|
||||
|
||||
### 移除
|
||||
|
||||
- 移除我的列表右键菜单的“上移、下移列表”功能,调整改用新增的拖动功能去调整位置
|
||||
|
||||
### 其他
|
||||
|
||||
- 升级vue到 3.x
|
||||
|
||||
## [1.15.3](https://github.com/lyswhut/lx-music-desktop/compare/v1.15.2...v1.15.3) - 2021-11-21
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复设置-控制按钮位置选项与下载歌词编码格式选项命名冲突导致选项显示异常的问题
|
||||
- 修复播放下载列表时存在失效的歌曲会导致切歌不准确的问题
|
||||
- 修复潜在的音乐加载超时不会切歌的问题
|
||||
- 修复因kw源歌词接口停用导致该源歌词获取失败的问题
|
||||
|
||||
## [1.15.2](https://github.com/lyswhut/lx-music-desktop/compare/v1.15.3...v1.15.2) - 2021-11-09
|
||||
|
||||
### 其他
|
||||
|
||||
- 降级electron到v13.4.0(这修复了windows 7下播放歌曲时软件会崩溃的问题)
|
||||
|
||||
## [1.15.3](https://github.com/lyswhut/lx-music-desktop/compare/v1.15.1...v1.15.3) - 2021-11-09
|
||||
|
||||
### 其他
|
||||
|
||||
- 降级electron到v13.4.0(这修复了windows 7下播放歌曲时软件会崩溃的问题)
|
||||
|
||||
## [1.15.1](https://github.com/lyswhut/lx-music-desktop/compare/v1.15.0...v1.15.1) - 2021-11-09
|
||||
|
||||
### 优化
|
||||
|
||||
160
FAQ.md
160
FAQ.md
@@ -1,46 +1,11 @@
|
||||
# lx-music-desktop 常见问题
|
||||
|
||||
本文档已迁移到:<https://lyswhut.github.io/lx-music-doc/desktop/faq>
|
||||
|
||||
<!--
|
||||
在阅读本常见问题后,仍然无法解决你的问题,请提交issue或者加企鹅群`830125506`反馈(无事勿加,入群先看群公告),反馈时请**注明**已阅读常见问题!
|
||||
|
||||
## ~~软件为什么没有桌面歌词与自定义列表功能~~
|
||||
|
||||
洛雪音乐的最初定位不是作为播放器开发的,它主要用于**查找歌曲**,软件的播放功能仅用于试听,不建议用作为常用播放器使用。
|
||||
|
||||
## 音乐播放列表机制
|
||||
|
||||
1. 默认情况下,播放搜索列表、歌单列表、排行榜列表的歌曲时会自动将该歌曲添加到“我的列表”的试听列表后再播放,这与手动将歌曲添加到试听列表,再去试听列表找到这首歌点播放是等价的
|
||||
2. 如果你想要播放多首歌曲,需要使用多选功能(若不知道如何多选请看常见问题)多选后,将这些歌曲添加到“我的列表”播放,或使用稍后播放功能播放
|
||||
3. 第2条适用于搜索列表、歌单列表、排行榜列表、我的列表中的歌曲
|
||||
4. 对于歌单详情列表,除了可以使用第2条的方式播放外,你可以点击详情页上面的播放按钮临时播放当前歌单,或点击收藏将当前歌单收藏到“我的列表”后再去播放
|
||||
5. 对于排行榜详情列表,除了可以使用第2条的方式播放外,你可以在右击排行榜名字后弹出的菜单中,播放或收藏整个排行榜,这与第四条的歌单中的播放、与收藏按钮功能一致
|
||||
6. v1.18.0及之后新增了“双击列表里的歌曲时自动切换到当前列表播放”设置,默认关闭,此功能仅对歌单、排行榜有效
|
||||
7. 将歌曲添加“稍后播放”后,它们会被放在一个优先级最高的特殊队列中,点击“下一曲”时会消耗该队列中的歌曲,并且无法通过“上一曲”功能播放该队列的上一首歌曲
|
||||
8. 在切歌时若不是通过“上一曲”、“下一曲”功能切歌(例如直接点击“排行榜列表”、“我的列表”中的歌曲切歌),“稍后播放”队列将会被清空
|
||||
|
||||
## 可用的鼠标、键盘快捷操作
|
||||
|
||||
- 鼠标右击播放栏的歌曲图片封面可以定位当前播放的歌曲
|
||||
- 鼠标右击播放栏进度条上的`LRC`按钮可以锁定/解锁桌面歌词
|
||||
- 歌曲搜索框、歌单链接输入框内鼠标右击可以将当前剪贴板上的文字粘贴到输入框内
|
||||
- 鼠标右击搜索界面中的单条搜索历史可以将其移除
|
||||
- 歌曲列表内的文字在选中后,鼠标右击可以复制已选中的文字,此功能只对搜索、歌单、排行榜、我的列表中的列表有效
|
||||
- 鼠标在播放详情页内右键双击可以关闭播放详情页
|
||||
- 鼠标左击播放栏上的歌曲名字可以将它复制
|
||||
- 鼠标右击设置-主题设置的“道法自然(英文Auto)”主题可以打开亮、暗主题设置窗口
|
||||
- 歌曲搜索框的候选内容可以用键盘上下方向键选择,按回车键搜索已选内容
|
||||
- 在歌单详情页按退格键可以返回歌单列表
|
||||
- 歌曲列表中可以使用`Ctrl`、`Shift`键进行多选,这类似Windows下的文件选择,详情看常见问题列表多选部分
|
||||
- 在我的列表内可以使用`Ctrl + f`键打开搜索框进行列表内歌曲搜索,搜索框按`Esc`键可以关闭搜索框,搜索框内按上下方向键可以选择歌曲,按`回车`键跳转到已选歌曲,按`Ctrl + 回车`可以跳转并播放已选歌曲
|
||||
- 在我的列表按住`Ctrl`键可以进入列表拖动模式,此时可以用鼠标拖动列表调整列表的位置
|
||||
- 编辑列表名时按`Esc`键可以取消编辑
|
||||
- 按`F11`可以进入、退出全屏状态(v1.19.0新增)
|
||||
- 在歌曲添加弹窗中,若按住`Ctrl`键后再点击列表名,将不会自动关闭添加窗口,这对想要将同一首(一批)歌曲添加到多个列表时会很有用(v1.22.0新增)
|
||||
|
||||
注:在macOS上`Ctrl`键对应`Command`键
|
||||
|
||||
## 歌曲无法试听与下载
|
||||
|
||||
### 所有歌曲都提示 `请求异常😮,可以多试几次,若还是不行就换一首吧。。。`
|
||||
@@ -50,7 +15,7 @@
|
||||
|
||||
### 提示 `getaddrinfo EAI_AGAIN ...` 或 `无法连接到服务器`
|
||||
|
||||
尝试在在浏览器打开这个地址`http://ts.tempmusics.tk`,浏览器显示404是正常的,如果不是404那就证明所在网络无法访问接口服务器。
|
||||
尝试在在浏览器打开这个地址`http://ts.tempmusic.tk`,浏览器显示404是正常的,如果不是404那就证明所在网络无法访问接口服务器。
|
||||
若网页无法打开或打开来不是404,则可能是DNS的问题,可以尝试以下办法:
|
||||
|
||||
1. 将DNS改成自动获取试试(注:改完可能需要清理下系统DNS缓存才生效)
|
||||
@@ -69,22 +34,12 @@
|
||||
5. 若还不行请到这个链接查看详情:<https://github.com/lyswhut/lx-music-desktop/issues/5>
|
||||
6. 若没有在第5条链接中的第一条评论中看到接口无法使用的说明,则应该是你网络无法访问接口服务器的问题,如果接口有问题我会在那里说明。
|
||||
|
||||
想要知道是不是自己网络的问题可以看看`http://ts.tempmusics.tk`能不能在浏览器打开,浏览器显示404是正常的,如果不是404那就证明所在网络无法访问接口服务器。
|
||||
想要知道是不是自己网络的问题可以看看`http://ts.tempmusic.tk`能不能在浏览器打开,浏览器显示404是正常的,如果不是404那就证明所在网络无法访问接口服务器。
|
||||
若网页无法打开或打来不是404,则应该是DNS的问题,可以尝试以下办法:
|
||||
|
||||
1. 将DNS改成自动获取试试
|
||||
2. 手动把DNS改一下,不要用360的DNS,可以把DNS改成`223.6.6.6`、`8.8.8.8`
|
||||
|
||||
### Windows版所有歌曲都提示 `音频加载错误,5秒后切换下一首`
|
||||
|
||||
尝试关闭 Internet选项 的代理设置。
|
||||
|
||||
如果你不知道怎么做,可以尝试按以下步骤去做:
|
||||
|
||||
按<kbd>windows</kbd>+<kbd>r</kbd>键打开“运行”窗口,输入`inetcpl.cpl`后回车,在打开的 Internet选项 对话框中,切换到 连接 -> 局域网设置,在弹出的新窗口中把代理服务器下的勾去掉,如果自动配置下的勾也有被勾选,那么建议也去掉,最后按确定关闭所有弹窗。
|
||||
|
||||
> 来源:<https://github.com/lyswhut/lx-music-desktop/issues/873#issuecomment-1146945724>
|
||||
|
||||
## 列表多选
|
||||
|
||||
从v0.18.0起,列表多选需要键盘配合,想要多选前需按下`Shift`或`Ctrl`键然后再鼠标点击想要选中的内容即可触发多选机制,其中`Shift`键用于连续选择,`Ctrl`键用于不连续选择,`Ctrl+a`用于快速全选。
|
||||
@@ -128,7 +83,7 @@
|
||||
|
||||
这些浏览器打开此窗口时界面可能是中文也可能是英文,英文的话按括号里的来
|
||||
|
||||
1. 点击窗口顶部`应用程序(application)`(若找不到此选项,则可能是被折叠起来了,看看顶部菜单的`>>`)
|
||||
1. 点击窗口顶部`应用程序(application)`
|
||||
2. 展开左侧 `Cookies`
|
||||
3. 点击 `https://music.163.com`
|
||||
4. 在右侧窗口找到 `名称(Name)` 为 `MUSIC_U` 的这行,这行的第二列(`值(Value)`)内的那串内容就是`token`,双击它进入编辑状态,然后按`ctrl + c`键就可以将它复制
|
||||
@@ -146,9 +101,6 @@
|
||||
|
||||
需要注意的是:这将会覆盖本地的目标列表,歌曲将被替换成最新的在线列表。
|
||||
|
||||
## 调整我的列表的列表顺序
|
||||
|
||||
按住Ctrl键(Mac上对应Command键)的时候将进入“拖动模式”,此时可以拖动列表的位置来调整顺序。
|
||||
|
||||
## 同步功能的使用(实验性,首次使用前建议先备份一次列表)
|
||||
|
||||
@@ -171,34 +123,11 @@
|
||||
- 检查防火墙是否拦截了PC端的服务端口
|
||||
- 路由器若开启了AP隔离,则此功能无法使用
|
||||
|
||||
#### 连接同步服务失败的检查
|
||||
|
||||
1. 确保PC端的同步服务已启用成功(若连接码、同步服务地址没有内容,则证明服务启动失败,此时看启用同步功能复选框后面的错误信息自行解决,另外若你不知道端口号是什么意思就不要乱改,或不要改得太大与太小)
|
||||
2. 在手机浏览器地址栏输入`http://x.x.x.x:23332/hello` **(注:将`x.x.x.x`换成PC端显示的同步服务地址,`23332`为PC端的端口号)** 后回车,若此地址可以打开并显示 `Hello~::^-^::`则证明移动端与PC端网络已互通,
|
||||
3. 若移动端无法打开第2步的地址,则在PC端的浏览器地址栏输入并打开该地址,若可以打开,则要么是被LX Music PC端被电脑防火墙拦截,要么PC端与移动端不在同一个网络下,或者路由器开启了AP隔离(一般在公共网络下会出现这种情况)
|
||||
|
||||
## 界面异常(界面显示不完整)
|
||||
|
||||
### Windows 10、11界面异常、界面无法显示
|
||||
|
||||
尝试添加运行参数 `--disable-gpu-sandbox` 启动,例如:`.\lx-music-desktop.exe --disable-gpu-sandbox`,添加方法可自行百度“给快捷方式加参数”。
|
||||
|
||||
若以上方法无效,则尝试将 `--disable-gpu-sandbox` 逐个换成以下参数启动,直到恢复正常为止:
|
||||
|
||||
- `--no-sandbox`
|
||||
- `-dha`
|
||||
- `--disable-gpu`
|
||||
|
||||
:::caution
|
||||
这些参数会禁用程序的某些安全特性或降低程序性能,没有遇到问题不要使用它们!
|
||||
:::
|
||||
|
||||
对于界面无法显示,任务栏里也没看到图标,但是任务管理器里面看到进程的问题,还可尝试更换软件安装目录(对于安装版需要先卸载再换目录安装,绿色版直接剪切移动即可,只要目录换了就行),<br />
|
||||
此方法的相关讨论看:<https://github.com/lyswhut/lx-music-desktop/issues/943#issuecomment-1217832186>
|
||||
|
||||
### Windows 7 下界面异常
|
||||
|
||||
由于软件默认使用了透明窗口,根据Electron官方文档的[说明](https://www.electronjs.org/docs/latest/tutorial/window-customization#limitations):
|
||||
由于软件默认使用了透明窗口,根据Electron官方文档的[说明](https://electronjs.org/docs/api/frameless-window#%E5%B1%80%E9%99%90%E6%80%A7):
|
||||
> 在 windows 操作系统上, 当 DWM 被禁用时, 透明窗口将无法工作。
|
||||
|
||||
因此,当 win7 没有使用**Aero**主题时界面将会显示异常,开启AERO的方法请自行百度:`win7开启Aero效果`(开启后可看到任务栏变透明)。<br>
|
||||
@@ -315,26 +244,6 @@ Windows 7 未开启 Aero 效果时桌面歌词会有问题,详情看上面的
|
||||
- 以管理员权限打开`cmd`,输入`sfc /scannow`回车等待检查完成重启电脑
|
||||
- 若上面的方法**修复、重启**电脑后仍然不行,就自行百度弹出的**错误信息**看下别人是怎么解决的
|
||||
|
||||
## MAC OS无法启动软件,提示 lx-music-desktop 已损坏
|
||||
|
||||
这是因为软件没有签名,被系统阻止运行,<br>
|
||||
在终端里输入 `sudo xattr -rd com.apple.quarantine /Applications/lx-music-desktop.app`,然后输入你的电脑密码即可
|
||||
|
||||
还可以参考:
|
||||
|
||||
- <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>
|
||||
@@ -345,58 +254,6 @@ 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><br>
|
||||
以下是目前可用的Scheme URL调用方式:
|
||||
|
||||
- URL统一以`lxmusic://`开头
|
||||
- 若无特别说明,源的可用值为:`kw/kg/tx/wy/mg`
|
||||
- 若无特别说明,音质的可用值为:`128k/320k/flac/flac24bit`
|
||||
|
||||
目前支持两种传参方式:
|
||||
|
||||
- 通过`data`传参,以经过URL编码的JSON数据传参,例:`lxmusic://music/play?data=xxxx`,其中`xxxx`为经过URL编码后的JSON数据,支持复杂的参数调用
|
||||
- 通过`URL`传参,适用于简单传参的调用,不需要转成JSON格式,例:`lxmusic://music/search/xxxx`,但仍然需要对数据进行URL编码,只适应于简单参数调用(v1.18.0新增)
|
||||
|
||||
### `data`方式传参
|
||||
|
||||
以经过URL编码的JSON数据传参,例:`lxmusic://music/play?data=xxxx`,其中`xxxx`为经过URL编码后的JSON数据,JSON数据内容取决于下表的参数部分
|
||||
|
||||
| 描述 | 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/search` | `keywords<String/Number>`(要搜索的内容,必须)<br>`source<String>`(源,可选)
|
||||
| 播放歌曲 | `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源专用,选传)
|
||||
|
||||
### `URL`方式传参
|
||||
|
||||
由于URL传参只适用于简单传参场景,所以目前只支持以下功能的调用:
|
||||
|
||||
| 描述 | URL | 参数
|
||||
| --- | --- | ---
|
||||
| 搜索歌曲 | `music/search/{source}/{keywords}` | `source`(源,可选)<br>`keywords`(要搜索的内容,必须)<br>例:`music/search/kw/xxx`、`music/search/xxx`
|
||||
| 打开歌单 | `songlist/open/{source}/{id/url}` | `source`(源,必须)<br>`id/url`(歌单ID或歌单URL,必须)<br>例:`songlist/open/kw/123456`
|
||||
|
||||
## 自定义源脚本编写说明
|
||||
|
||||
文件请使用UTF-8编码格式编写,脚本所用编程语言为JavaScript,可以使用ES6+语法,脚本与应用的交互是使用类似事件收发的方式进行,这是一个基本的脚本例子:
|
||||
@@ -465,7 +322,7 @@ send(EVENT_NAMES.inited, {
|
||||
name: '酷我音乐',
|
||||
type: 'music', // 目前固定为 music
|
||||
actions: ['musicUrl'], // 目前固定为 ['musicUrl']
|
||||
qualitys: ['128k', '320k', 'flac', 'flac24bit'], // 当前脚本的该源所支持获取的Url音质,有效的值有:['128k', '320k', 'flac', 'flac24bit']
|
||||
qualitys: ['128k', '320k', 'flac'], // 当前脚本的该源所支持获取的Url音质,有效的值有:['128k', '320k', 'flac']
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -507,9 +364,8 @@ send(EVENT_NAMES.inited, {
|
||||
|
||||
| 事件名 | 描述
|
||||
| --- | ---
|
||||
| `inited` | 脚本初始化完成后发送给应用的事件名,发送该事件时需要传入以下信息:`{status, sources, openDevTools}`<br>`status`:初始化结果(`true`成功,`false`失败)<br>`openDevTools`:是否打开DevTools,此选项可用于开发脚本时的调试<br>`sources`:支持的源信息对象,<br>`sources[kw/kg/tx/wy/mg].name`:源的名字(目前非必须)<br>`sources[kw/kg/tx/wy/mg].type`:源类型,目前固定值需为`music`<br>`sources[kw/kg/tx/wy/mg].actions`:支持的actions,由于目前只支持`musicUrl`,所以固定传`['musicUrl']`即可<br>`sources[kw/kg/tx/wy/mg].qualitys`:该源支持的音质列表,有效的值为`['128k', '320k', 'flac', 'flac24bit']`,该字段用于控制应用可用的音质类型
|
||||
| `request` | 应用API请求事件名,回调入参:`handler({ source, action, info})`,回调必须返回`Promise`对象<br>`source`:音乐源,可能的值取决于初始化时传入的`sources`对象的源key值<br>`info`:请求附加信息,内容根据`action`变化<br>`action`:请求操作类型,目前只有`musicUrl`,即获取音乐URL链接,需要在 Promise 返回歌曲 url,`info`的结构:`{type, musicInfo}`,`info.type`:音乐质量,可能的值有`128k` / `320k` / `flac` / `flac24bit`(取决于初始化时对应源传入的`qualitys`值中的一个),`info.musicInfo`:音乐信息对象,里面有音乐ID、名字等信息
|
||||
| `updateAlert` | 显示源更新弹窗,发送该事件时的参数:`{log, updateUrl}`<br>`log`:更新日志,必传,字符串类型,内容可以使用`\n`换行,最大长度1024,超过此长度后将被截取超出的部分<br>`updateUrl`:更新地址,用于引导用户去该地址更新源,选传,需为http协议的url地址,最大长度1024<br>此事件每次运行脚本只能调用一次(源版本v1.2.0新增)<br>例子:`lx.send(lx.EVENT_NAMES.updateAlert, { log: 'hello world', updateUrl: 'https://xxx.com' })`
|
||||
| `inited` | 脚本初始化完成后发送给应用的事件名,发送该事件时需要传入以下信息:`{status, sources, openDevTools}`<br>`status`:初始化结果(`true`成功,`false`失败)<br>`openDevTools`:是否打开DevTools,此选项可用于开发脚本时的调试<br>`sources`:支持的源信息对象,<br>`sources[kw/kg/tx/wy/mg].name`:源的名字(目前非必须)<br>`sources[kw/kg/tx/wy/mg].type`:源类型,目前固定值需为`music`<br>`sources[kw/kg/tx/wy/mg].actions`:支持的actions,由于目前只支持`musicUrl`,所以固定传`['musicUrl']`即可<br>`sources[kw/kg/tx/wy/mg].qualitys`:该源支持的音质列表,有效的值为`['128k', '320k', 'flac']`,该字段用于控制应用可用的音质类型
|
||||
| `request` | 应用API请求事件名,回调入参:`handler({ source, action, info})`,回调必须返回`Promise`对象<br>`source`:音乐源,可能的值取决于初始化时传入的`sources`对象的源key值<br>`info`:请求附加信息,内容根据`action`变化<br>`action`:请求操作类型,目前只有`musicUrl`,即获取音乐URL链接,需要在 Promise 返回歌曲 url,`info`的结构:`{type, musicInfo}`,`info.type`:音乐质量,可能的值有`128k` / `320k` / `flac`(取决于初始化时对应源传入的`qualitys`值中的一个),`info.musicInfo`:音乐信息对象,里面有音乐ID、名字等信息
|
||||
|
||||
|
||||
#### `window.lx.on`
|
||||
@@ -563,4 +419,4 @@ const cancelHttp = window.lx.request(url, options, callback)
|
||||
- `window.lx.utils.crypto.randomBytes`:生成随机字符串 `randomBytes(size)`
|
||||
- `window.lx.utils.crypto.rsaEncrypt`:RSA加密 `rsaEncrypt(buffer, key)`
|
||||
|
||||
目前仅提供以上工具方法,如果需要其他方法可以开issue讨论。 -->
|
||||
目前仅提供以上工具方法,如果需要其他方法可以开issue讨论。
|
||||
|
||||
80
README.md
80
README.md
@@ -36,8 +36,8 @@
|
||||
|
||||
所用技术栈:
|
||||
|
||||
- Electron 15+
|
||||
- Vue 3
|
||||
- Electron 15
|
||||
- Vue 2
|
||||
|
||||
已支持的平台:
|
||||
|
||||
@@ -48,48 +48,11 @@
|
||||
软件变化请查看:[更新日志](https://github.com/lyswhut/lx-music-desktop/blob/master/CHANGELOG.md)<br>
|
||||
软件下载请转到:[发布页面](https://github.com/lyswhut/lx-music-desktop/releases)<br>
|
||||
或者到网盘下载(网盘内有MAC、windows版):`https://www.lanzoui.com/b0bf2cfa/` 密码:`glqw`(若链接无法打开请百度:蓝奏云链接打不开)<br>
|
||||
使用常见问题请转至:[常见问题](https://lyswhut.github.io/lx-music-doc/desktop/faq)
|
||||
|
||||
目前本项目的原始发布地址只有**GitHub**及**蓝奏网盘**,其他渠道均为第三方转载发布,与本项目无关!
|
||||
|
||||
#### 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><br>
|
||||
|
||||
若你想自己调用LX Music,可以看[Scheme URL支持](https://lyswhut.github.io/lx-music-doc/desktop/scheme-url)
|
||||
|
||||
#### 数据同步服务
|
||||
|
||||
从v2.2.0起,我们发布了一个独立版的[数据同步服务](https://github.com/lyswhut/lx-music-sync-server#readme),如果你有服务器,可以将其部署到服务器上作为私人多端同步服务使用,详情看该项目说明
|
||||
|
||||
#### 启动参数
|
||||
|
||||
目前软件已支持的启动参数如下:
|
||||
|
||||
- `-proxy-server` 设置代理服务器,代理应用的所有流量
|
||||
- `-proxy-bypass-list` 以分号分隔的主机列表绕过代理服务器
|
||||
- `-play` 启动时播放指定列表的音乐
|
||||
- `-search` 启动软件时自动在搜索框搜索指定的内容
|
||||
- `-dha` 禁用硬件加速启动(Disable Hardware Acceleration)
|
||||
- `-dt` 以非透明模式启动(Disable Transparent)
|
||||
- `-dhmkh` 禁用硬件媒体密钥处理(Disable Hardware Media Key Handling)
|
||||
|
||||
启动参数的详细说明请看[启动参数说明](https://lyswhut.github.io/lx-music-doc/desktop/run-params)
|
||||
|
||||
#### 数据存储路径
|
||||
|
||||
默认情况下,软件的数据存储在:
|
||||
|
||||
- Windows:`%APPDATA%/lx-music-desktop`
|
||||
- Linux:`$XDG_CONFIG_HOME/lx-music-desktop` 或 `~/.config/lx-music-desktop`
|
||||
- macOS:`~/Library/Application Support/lx-music-desktop`
|
||||
|
||||
在Windows平台下,若程序目录下存在`portable`目录,则自动使用此目录作为数据存储目录(v1.17.0新增)。
|
||||
使用常见问题请转至:[常见问题](https://github.com/lyswhut/lx-music-desktop/blob/master/FAQ.md)
|
||||
|
||||
### 源码使用方法
|
||||
|
||||
环境要求:Node.js 16+
|
||||
环境要求:Node.js 14+
|
||||
|
||||
```bash
|
||||
# 开发模式
|
||||
@@ -113,23 +76,25 @@ 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://lyswhut.github.io/lx-music-doc/desktop/faq>
|
||||
|
||||
### 贡献代码
|
||||
|
||||
本项目欢迎PR,但为了PR能顺利合并,需要注意以下几点:
|
||||
|
||||
- 对于添加新功能的PR,建议在PR前先创建issue说明,以确认该功能是否确实需要
|
||||
- 对于修复Bug PR,请提供修复前后的说明及重现方式
|
||||
- 其他类型的PR则适当附上说明
|
||||
|
||||
贡献代码步骤:
|
||||
|
||||
1. 参照[源码使用方法](https://lyswhut.github.io/lx-music-doc/desktop/use-source-code)设置开发环境
|
||||
2. 克隆本仓库代码并切换到`dev`分支开发
|
||||
3. 提交PR
|
||||
常见问题已移至:<https://github.com/lyswhut/lx-music-desktop/blob/master/FAQ.md>
|
||||
|
||||
### 项目协议
|
||||
|
||||
@@ -147,5 +112,4 @@ npm run pack:linux
|
||||
若你使用了本项目,将代表你接受以上协议。
|
||||
|
||||
音乐平台不易,请尊重版权,支持正版。<br>
|
||||
本项目仅用于对技术可行性的探索及研究,不接受任何商业(包括但不限于广告等)合作及捐赠。<br>
|
||||
若对此有疑问请 mail to: lyswhut+qq.com (请将`+`替换成`@`)<br>
|
||||
若对此有疑问请 mail to: lyswhut+qq.com (请将`+`替换成`@`)
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
const fs = require('fs').promises
|
||||
|
||||
// https://github.com/electron-userland/electron-builder/issues/4630
|
||||
// https://github.com/electron-userland/electron-builder/issues/4630#issuecomment-782020139
|
||||
|
||||
module.exports = async(context) => {
|
||||
const { electronPlatformName, appOutDir } = context
|
||||
if (electronPlatformName !== 'darwin') return
|
||||
const {
|
||||
productFilename,
|
||||
info: {
|
||||
_metadata: { macLanguagesInfoPlistStrings },
|
||||
},
|
||||
} = context.packager.appInfo
|
||||
|
||||
const resPath = `${appOutDir}/${productFilename}.app/Contents/Resources`
|
||||
|
||||
// 创建APP语言包文件
|
||||
return await Promise.all(
|
||||
Object.entries(macLanguagesInfoPlistStrings).map(([lang, config]) => {
|
||||
let infos = Object.entries(config).map(([k, v]) => `"${k}" = "${v}";`).join('\n')
|
||||
return fs.writeFile(`${resPath}/${lang}.lproj/InfoPlist.strings`, infos)
|
||||
}),
|
||||
)
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
const fs = require('fs')
|
||||
const fsPromises = require('fs').promises
|
||||
const path = require('path')
|
||||
const { Arch } = require('electron-builder')
|
||||
|
||||
const better_sqlite3_fileNameMap = {
|
||||
[Arch.x64]: 'electron-v110-linux-x64',
|
||||
[Arch.arm64]: 'electron-v110-linux-arm64',
|
||||
[Arch.armv7l]: 'electron-v110-linux-arm',
|
||||
}
|
||||
|
||||
const qrc_decode_fileNameMap = {
|
||||
win32: {
|
||||
[Arch.x64]: 'electron-v110-win32-x64',
|
||||
[Arch.ia32]: 'electron-v110-win32-ia32',
|
||||
[Arch.arm64]: 'electron-v110-win32-arm64',
|
||||
},
|
||||
linux: {
|
||||
[Arch.x64]: 'electron-v110-linux-x64',
|
||||
[Arch.arm64]: 'electron-v110-linux-arm64',
|
||||
[Arch.armv7l]: 'electron-v110-linux-arm',
|
||||
},
|
||||
darwin: {
|
||||
[Arch.x64]: 'electron-v110-darwin-x64',
|
||||
[Arch.arm64]: 'electron-v110-darwin-arm64',
|
||||
},
|
||||
}
|
||||
|
||||
const replaceSqliteLib = async(arch) => {
|
||||
// console.log(await fs.readdir(path.join(context.appOutDir, './resources/')))
|
||||
// if (context.electronPlatformName != 'linux' || context.arch != Arch.arm64) return
|
||||
// https://github.com/lyswhut/lx-music-desktop/issues/1102
|
||||
// https://github.com/lyswhut/lx-music-desktop/issues/1161
|
||||
console.log('replace sqlite lib...')
|
||||
const filePath = path.join(__dirname, `./lib/better_sqlite3_${better_sqlite3_fileNameMap[arch]}.node`)
|
||||
const targetPath = path.join(__dirname, '../node_modules/better-sqlite3/build/Release/better_sqlite3.node')
|
||||
await fsPromises.unlink(targetPath).catch(_ => _)
|
||||
await fsPromises.copyFile(filePath, targetPath)
|
||||
}
|
||||
|
||||
const replaceQrcDecodeLib = async(platform, arch) => {
|
||||
console.log('replace qrc_decode lib...', platform, qrc_decode_fileNameMap[platform][arch])
|
||||
const filePath = path.join(__dirname, `./lib/qrc_decode_${qrc_decode_fileNameMap[platform][arch]}.node`)
|
||||
const targetPath = path.join(__dirname, '../build/Release/qrc_decode.node')
|
||||
const targetDir = path.dirname(targetPath)
|
||||
if (fs.existsSync(targetDir)) await fsPromises.unlink(targetPath).catch(_ => _)
|
||||
else await fsPromises.mkdir(targetDir, { recursive: true })
|
||||
await fsPromises.copyFile(filePath, targetPath)
|
||||
}
|
||||
|
||||
|
||||
module.exports = async(context) => {
|
||||
const { electronPlatformName, arch } = context
|
||||
await replaceQrcDecodeLib(electronPlatformName, arch)
|
||||
if (electronPlatformName !== 'linux' || process.env.FORCE) return
|
||||
const bindingFilePath = path.join(__dirname, '../node_modules/better-sqlite3/binding.gyp')
|
||||
const bindingBakFilePath = path.join(__dirname, '../node_modules/better-sqlite3/binding.gyp.bak')
|
||||
switch (arch) {
|
||||
case Arch.x64:
|
||||
case Arch.arm64:
|
||||
case Arch.armv7l:
|
||||
if (fs.existsSync(bindingFilePath)) {
|
||||
// console.log('rename binding file...')
|
||||
await fsPromises.rename(bindingFilePath, bindingBakFilePath)
|
||||
}
|
||||
await replaceSqliteLib(arch)
|
||||
break
|
||||
|
||||
default:
|
||||
if (fs.existsSync(bindingFilePath)) return
|
||||
// console.log('restore binding file...')
|
||||
await fsPromises.rename(bindingBakFilePath, bindingFilePath)
|
||||
break
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,23 +1,12 @@
|
||||
const path = require('path')
|
||||
const ESLintPlugin = require('eslint-webpack-plugin')
|
||||
|
||||
const isDev = process.env.NODE_ENV === 'development'
|
||||
|
||||
module.exports = {
|
||||
target: 'electron-main',
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
library: {
|
||||
type: 'commonjs2',
|
||||
},
|
||||
path: path.join(__dirname, '../../dist'),
|
||||
},
|
||||
externals: {
|
||||
'font-list': 'font-list',
|
||||
'better-sqlite3': 'better-sqlite3',
|
||||
bufferutil: 'bufferutil',
|
||||
'utf-8-validate': 'utf-8-validate',
|
||||
'qrc_decode.node': isDev ? path.join(__dirname, '../../build/Release/qrc_decode.node') : path.join('../build/Release/qrc_decode.node'),
|
||||
libraryTarget: 'commonjs2',
|
||||
path: path.join(__dirname, '../../dist/electron'),
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
@@ -26,7 +15,7 @@ module.exports = {
|
||||
'@lyric': path.join(__dirname, '../../src/renderer-lyric'),
|
||||
'@common': path.join(__dirname, '../../src/common'),
|
||||
},
|
||||
extensions: ['.tsx', '.ts', '.js', '.mjs', '.json', '.node'],
|
||||
extensions: ['*', '.js', '.json', '.node'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
@@ -34,13 +23,11 @@ module.exports = {
|
||||
test: /\.node$/,
|
||||
use: 'node-loader',
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
},
|
||||
performance: {
|
||||
maxEntrypointSize: 300000,
|
||||
},
|
||||
plugins: [
|
||||
new ESLintPlugin(),
|
||||
],
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
const path = require('path')
|
||||
const { merge } = require('webpack-merge')
|
||||
const webpack = require('webpack')
|
||||
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
|
||||
|
||||
const baseConfig = require('./webpack.config.base')
|
||||
|
||||
@@ -8,21 +9,27 @@ const baseConfig = require('./webpack.config.base')
|
||||
module.exports = merge(baseConfig, {
|
||||
mode: 'development',
|
||||
entry: {
|
||||
main: path.join(__dirname, '../../src/main/index-dev.ts'),
|
||||
// 'dbService.worker': path.join(__dirname, '../../src/main/worker/dbService/index.ts'),
|
||||
main: path.join(__dirname, '../../src/main/index.dev.js'),
|
||||
},
|
||||
devtool: 'eval-source-map',
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: '"development"',
|
||||
},
|
||||
webpackStaticPath: `"${path.join(__dirname, '../../src/static').replace(/\\/g, '\\\\')}"`,
|
||||
webpackUserApiPath: `"${path.join(__dirname, '../../src/main/modules/userApi').replace(/\\/g, '\\\\')}"`,
|
||||
__static: `"${path.join(__dirname, '../../src/static').replace(/\\/g, '\\\\')}"`,
|
||||
__userApi: `"${path.join(__dirname, '../../src/main/modules/userApi').replace(/\\/g, '\\\\')}"`,
|
||||
}),
|
||||
new FriendlyErrorsPlugin({
|
||||
onErrors(severity, errors) { // Silent warning from electron-debug
|
||||
if (severity != 'warning') return
|
||||
|
||||
for (let i = errors.length - 1; i > -1; i--) {
|
||||
const error = errors[i]
|
||||
if (error.file == './node_modules/electron-debug/index.js') errors.splice(i, 1)
|
||||
}
|
||||
// You can listen to errors transformed and prioritized by the plugin
|
||||
// severity can be 'error' or 'warning'
|
||||
},
|
||||
}),
|
||||
],
|
||||
performance: {
|
||||
maxEntrypointSize: 1024 * 1024 * 50,
|
||||
maxAssetSize: 1024 * 1024 * 30,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -5,17 +5,18 @@ const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
|
||||
const baseConfig = require('./webpack.config.base')
|
||||
|
||||
// const { dependencies } = require('../../package.json')
|
||||
|
||||
const buildConfig = require('../webpack-build-config')
|
||||
const { dependencies } = require('../../package.json')
|
||||
|
||||
|
||||
module.exports = merge(baseConfig, {
|
||||
mode: 'production',
|
||||
entry: {
|
||||
main: path.join(__dirname, '../../src/main/index.ts'),
|
||||
// 'dbService.worker': path.join(__dirname, '../../src/main/worker/dbService/index.ts'),
|
||||
main: path.join(__dirname, '../../src/main/index.js'),
|
||||
},
|
||||
externals: [
|
||||
...Object.keys(dependencies || {}),
|
||||
// 'font-list',
|
||||
],
|
||||
node: {
|
||||
__dirname: false,
|
||||
__filename: false,
|
||||
@@ -24,12 +25,12 @@ module.exports = merge(baseConfig, {
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: path.join(__dirname, '../../src/main/modules/userApi/renderer/user-api.html'),
|
||||
to: path.join(__dirname, '../../dist/userApi/renderer/user-api.html'),
|
||||
from: path.join(__dirname, '../../src/main/modules/userApi/renderer'),
|
||||
to: path.join(__dirname, '../../dist/electron/userApi/renderer'),
|
||||
},
|
||||
{
|
||||
from: path.join(__dirname, '../../src/common/theme/images/*').replace(/\\/g, '/'),
|
||||
to: path.join(__dirname, '../../dist/theme_images/[name][ext]'),
|
||||
from: path.join(__dirname, '../../src/main/modules/userApi/rendererEvent/name.js'),
|
||||
to: path.join(__dirname, '../../dist/electron/userApi/rendererEvent/name.js'),
|
||||
},
|
||||
],
|
||||
}),
|
||||
@@ -39,11 +40,4 @@ module.exports = merge(baseConfig, {
|
||||
},
|
||||
}),
|
||||
],
|
||||
performance: {
|
||||
maxEntrypointSize: 1024 * 1024 * 10,
|
||||
maxAssetSize: 1024 * 1024 * 20,
|
||||
},
|
||||
optimization: {
|
||||
minimize: buildConfig.minimize,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -5,25 +5,21 @@ const del = require('del')
|
||||
const webpack = require('webpack')
|
||||
const Spinnies = require('spinnies')
|
||||
|
||||
const mainConfig = './main/webpack.config.prod'
|
||||
const rendererConfig = './renderer/webpack.config.prod'
|
||||
const rendererLyricConfig = './renderer-lyric/webpack.config.prod'
|
||||
const rendererScriptConfig = './renderer-scripts/webpack.config.prod'
|
||||
const mainConfig = require('./main/webpack.config.prod')
|
||||
const rendererConfig = require('./renderer/webpack.config.prod')
|
||||
const rendererLyricConfig = require('./renderer-lyric/webpack.config.prod')
|
||||
|
||||
const errorLog = chalk.bgRed.white(' ERROR ') + ' '
|
||||
const okayLog = chalk.bgGreen.white(' OKAY ') + ' '
|
||||
|
||||
const { Worker, isMainThread, parentPort } = require('worker_threads')
|
||||
|
||||
|
||||
function build() {
|
||||
del.sync(['dist/**', 'build/**'])
|
||||
del.sync(['dist/electron/**', 'build/**'])
|
||||
|
||||
const spinners = new Spinnies({ color: 'blue' })
|
||||
spinners.add('main', { text: 'main building' })
|
||||
spinners.add('renderer', { text: 'renderer building' })
|
||||
spinners.add('renderer-lyric', { text: 'renderer-lyric building' })
|
||||
spinners.add('renderer-scripts', { text: 'renderer-scripts building' })
|
||||
let results = ''
|
||||
|
||||
// m.on('success', () => {
|
||||
@@ -67,35 +63,11 @@ function build() {
|
||||
console.error(`\n${err}\n`)
|
||||
process.exit(1)
|
||||
}),
|
||||
pack(rendererScriptConfig).then(result => {
|
||||
results += result + '\n\n'
|
||||
spinners.succeed('renderer-scripts', { text: 'renderer-scripts build success!' })
|
||||
}).catch(err => {
|
||||
spinners.fail('renderer-scripts', { text: 'renderer-scripts build fail :(' })
|
||||
console.log(`\n ${errorLog}failed to build renderer-scripts process`)
|
||||
console.error(`\n${err}\n`)
|
||||
process.exit(1)
|
||||
}),
|
||||
]).then(handleSuccess)
|
||||
}
|
||||
|
||||
function pack(config) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const worker = new Worker(__filename)
|
||||
const subChannel = new MessageChannel()
|
||||
worker.postMessage({ port: subChannel.port1, config }, [subChannel.port1])
|
||||
subChannel.port2.on('message', ({ status, message }) => {
|
||||
switch (status) {
|
||||
case 'success': return resolve(message)
|
||||
case 'error': return reject(message)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function runPack(config) {
|
||||
return new Promise((resolve, reject) => {
|
||||
config = require(config)
|
||||
config.mode = 'production'
|
||||
webpack(config, (err, stats) => {
|
||||
if (err) reject(err.stack || err)
|
||||
@@ -123,22 +95,5 @@ function runPack(config) {
|
||||
})
|
||||
}
|
||||
|
||||
if (isMainThread) build()
|
||||
else {
|
||||
parentPort.once('message', ({ port, config }) => {
|
||||
// assert(port instanceof MessagePort)
|
||||
runPack(config).then((result) => {
|
||||
port.postMessage({
|
||||
status: 'success',
|
||||
message: result,
|
||||
})
|
||||
}).catch((err) => {
|
||||
port.postMessage({
|
||||
status: 'error',
|
||||
message: err,
|
||||
})
|
||||
}).finally(() => {
|
||||
port.close()
|
||||
})
|
||||
})
|
||||
}
|
||||
build()
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
const { Arch } = require('electron-builder')
|
||||
require('./build-before-pack')({ electronPlatformName: process.platform, arch: Arch[process.arch] })
|
||||
@@ -1,7 +1,8 @@
|
||||
const path = require('path')
|
||||
const { VueLoaderPlugin } = require('vue-loader')
|
||||
const VueLoaderPlugin = require('vue-loader/lib/plugin')
|
||||
const HTMLPlugin = require('html-webpack-plugin')
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
const CleanCSSPlugin = require('less-plugin-clean-css')
|
||||
const ESLintPlugin = require('eslint-webpack-plugin')
|
||||
|
||||
const vueLoaderConfig = require('../vue-loader.config')
|
||||
@@ -12,44 +13,26 @@ const isDev = process.env.NODE_ENV === 'development'
|
||||
module.exports = {
|
||||
target: 'electron-renderer',
|
||||
entry: {
|
||||
'renderer-lyric': path.join(__dirname, '../../src/renderer-lyric/main.ts'),
|
||||
'renderer-lyric': path.join(__dirname, '../../src/renderer-lyric/main.js'),
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
library: {
|
||||
type: 'commonjs2',
|
||||
},
|
||||
path: path.join(__dirname, '../../dist'),
|
||||
libraryTarget: 'commonjs2',
|
||||
path: path.join(__dirname, '../../dist/electron'),
|
||||
publicPath: 'auto',
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.join(__dirname, '../../src'),
|
||||
'@main': path.join(__dirname, '../../src/main'),
|
||||
'@renderer': path.join(__dirname, '../../src/renderer'),
|
||||
'@lyric': path.join(__dirname, '../../src/renderer-lyric'),
|
||||
'@static': path.join(__dirname, '../../src/static'),
|
||||
'@common': path.join(__dirname, '../../src/common'),
|
||||
},
|
||||
extensions: ['.tsx', '.ts', '.js', '.json', '.vue', '.node'],
|
||||
extensions: ['*', '.js', '.json', '.vue', '.node'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'ts-loader',
|
||||
options: {
|
||||
appendTsSuffixTo: [/\.vue$/],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.node$/,
|
||||
use: 'node-loader',
|
||||
@@ -60,8 +43,9 @@ module.exports = {
|
||||
options: vueLoaderConfig,
|
||||
},
|
||||
{
|
||||
test: /\.pug$/,
|
||||
loader: 'pug-plain-loader',
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
@@ -73,12 +57,30 @@ module.exports = {
|
||||
loader: 'less-loader',
|
||||
options: {
|
||||
sourceMap: true,
|
||||
lessOptions: {
|
||||
plugins: [
|
||||
new CleanCSSPlugin({ advanced: true }),
|
||||
],
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
{
|
||||
test: /\.pug$/,
|
||||
oneOf: [
|
||||
// Use pug-plain-loader handle .vue file
|
||||
{
|
||||
resourceQuery: /vue/,
|
||||
use: ['pug-plain-loader'],
|
||||
},
|
||||
// Use pug-loader handle .pug file
|
||||
{
|
||||
use: ['pug-loader'],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||
exclude: path.join(__dirname, '../../src/renderer/assets/svgs'),
|
||||
type: 'asset',
|
||||
parser: {
|
||||
dataUrlCondition: {
|
||||
@@ -89,20 +91,6 @@ module.exports = {
|
||||
filename: 'imgs/[name]-[contenthash:8][ext]',
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.svg$/,
|
||||
include: path.join(__dirname, '../../src/renderer/assets/svgs'),
|
||||
use: [
|
||||
{
|
||||
loader: 'svg-sprite-loader',
|
||||
options: {
|
||||
symbolId: 'icon-[name]',
|
||||
},
|
||||
},
|
||||
'svg-transform-loader',
|
||||
'svgo-loader',
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
|
||||
type: 'asset',
|
||||
@@ -129,12 +117,16 @@ module.exports = {
|
||||
},
|
||||
],
|
||||
},
|
||||
performance: {
|
||||
maxEntrypointSize: 300000,
|
||||
},
|
||||
plugins: [
|
||||
new HTMLPlugin({
|
||||
filename: 'lyric.html',
|
||||
template: path.join(__dirname, '../../src/renderer-lyric/index.html'),
|
||||
template: path.join(__dirname, '../../src/renderer-lyric/index.pug'),
|
||||
isProd: process.env.NODE_ENV == 'production',
|
||||
browser: process.browser,
|
||||
scriptLoading: 'blocking',
|
||||
__dirname,
|
||||
}),
|
||||
new VueLoaderPlugin(),
|
||||
@@ -146,7 +138,6 @@ module.exports = {
|
||||
}),
|
||||
new ESLintPlugin({
|
||||
extensions: ['js', 'vue'],
|
||||
formatter: require('eslint-formatter-friendly'),
|
||||
}),
|
||||
],
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
|
||||
|
||||
const { merge } = require('webpack-merge')
|
||||
|
||||
@@ -9,14 +10,14 @@ module.exports = merge(baseConfig, {
|
||||
mode: 'development',
|
||||
devtool: 'eval-source-map',
|
||||
plugins: [
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new FriendlyErrorsPlugin(),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: '"development"',
|
||||
ELECTRON_DISABLE_SECURITY_WARNINGS: 'true',
|
||||
},
|
||||
__VUE_OPTIONS_API__: 'true',
|
||||
__VUE_PROD_DEVTOOLS__: 'false',
|
||||
staticPath: `"${path.join(__dirname, '../../src/static').replace(/\\/g, '\\\\')}"`,
|
||||
__static: `"${path.join(__dirname, '../../src/static').replace(/\\/g, '\\\\')}"`,
|
||||
}),
|
||||
],
|
||||
performance: {
|
||||
|
||||
@@ -1,43 +1,45 @@
|
||||
// const path = require('path')
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
|
||||
const TerserPlugin = require('terser-webpack-plugin')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const { merge } = require('webpack-merge')
|
||||
|
||||
const baseConfig = require('./webpack.config.base')
|
||||
const buildConfig = require('../webpack-build-config')
|
||||
|
||||
// const { dependencies } = require('../../package.json')
|
||||
const { dependencies } = require('../../package.json')
|
||||
|
||||
// let whiteListedModules = ['vue']
|
||||
// let whiteListedModules = ['vue', 'vue-router', 'vuex', 'vue-i18n']
|
||||
let whiteListedModules = ['vue']
|
||||
|
||||
|
||||
module.exports = merge(baseConfig, {
|
||||
mode: 'production',
|
||||
devtool: false,
|
||||
externals: [
|
||||
// ...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d)),
|
||||
...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d)),
|
||||
],
|
||||
plugins: [
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: path.join(__dirname, '../../src/static'),
|
||||
to: path.join(__dirname, '../../dist/electron/static'),
|
||||
},
|
||||
],
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: '"production"',
|
||||
},
|
||||
__VUE_OPTIONS_API__: 'true',
|
||||
__VUE_PROD_DEVTOOLS__: 'false',
|
||||
}),
|
||||
],
|
||||
optimization: {
|
||||
minimize: buildConfig.minimize,
|
||||
minimizer: [
|
||||
new TerserPlugin(),
|
||||
new CssMinimizerPlugin(),
|
||||
],
|
||||
},
|
||||
performance: {
|
||||
maxEntrypointSize: 1024 * 1024 * 10,
|
||||
maxAssetSize: 1024 * 1024 * 20,
|
||||
hints: 'warning',
|
||||
},
|
||||
node: {
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
const path = require('path')
|
||||
const ESLintPlugin = require('eslint-webpack-plugin')
|
||||
|
||||
module.exports = {
|
||||
target: 'electron-renderer',
|
||||
entry: {
|
||||
'user-api-preload': path.join(__dirname, '../../src/main/modules/userApi/renderer/preload.js'),
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
library: {
|
||||
type: 'commonjs2',
|
||||
},
|
||||
path: path.join(__dirname, '../../dist'),
|
||||
publicPath: 'auto',
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.join(__dirname, '../../src'),
|
||||
'@main': path.join(__dirname, '../../src/main'),
|
||||
'@renderer': path.join(__dirname, '../../src/renderer'),
|
||||
'@lyric': path.join(__dirname, '../../src/renderer-lyric'),
|
||||
'@static': path.join(__dirname, '../../src/static'),
|
||||
'@common': path.join(__dirname, '../../src/common'),
|
||||
},
|
||||
extensions: ['.tsx', '.ts', '.js', '.json', '.vue', '.node'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'ts-loader',
|
||||
options: {
|
||||
appendTsSuffixTo: [/\.vue$/],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.node$/,
|
||||
use: 'node-loader',
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new ESLintPlugin({
|
||||
extensions: ['js'],
|
||||
formatter: require('eslint-formatter-friendly'),
|
||||
}),
|
||||
],
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
|
||||
const { merge } = require('webpack-merge')
|
||||
|
||||
const baseConfig = require('./webpack.config.base')
|
||||
|
||||
module.exports = merge(baseConfig, {
|
||||
mode: 'development',
|
||||
devtool: 'eval-source-map',
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: '"development"',
|
||||
ELECTRON_DISABLE_SECURITY_WARNINGS: 'true',
|
||||
},
|
||||
staticPath: `"${path.join(__dirname, '../../src/static').replace(/\\/g, '\\\\')}"`,
|
||||
}),
|
||||
],
|
||||
performance: {
|
||||
hints: false,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
// const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const TerserPlugin = require('terser-webpack-plugin')
|
||||
const { merge } = require('webpack-merge')
|
||||
|
||||
const baseConfig = require('./webpack.config.base')
|
||||
const buildConfig = require('../webpack-build-config')
|
||||
|
||||
// const { dependencies } = require('../../package.json')
|
||||
|
||||
// let whiteListedModules = ['vue']
|
||||
// let whiteListedModules = ['vue', 'vue-router', 'vuex', 'vue-i18n']
|
||||
|
||||
|
||||
module.exports = merge(baseConfig, {
|
||||
mode: 'production',
|
||||
devtool: false,
|
||||
externals: [
|
||||
// ...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d)),
|
||||
],
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: '"production"',
|
||||
},
|
||||
}),
|
||||
],
|
||||
optimization: {
|
||||
minimize: buildConfig.minimize,
|
||||
minimizer: [
|
||||
new TerserPlugin(),
|
||||
],
|
||||
},
|
||||
performance: {
|
||||
maxEntrypointSize: 1024 * 1024 * 10,
|
||||
maxAssetSize: 1024 * 1024 * 20,
|
||||
hints: 'warning',
|
||||
},
|
||||
node: {
|
||||
__dirname: false,
|
||||
__filename: false,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
const path = require('path')
|
||||
const { VueLoaderPlugin } = require('vue-loader')
|
||||
const VueLoaderPlugin = require('vue-loader/lib/plugin')
|
||||
const HTMLPlugin = require('html-webpack-plugin')
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
const CleanCSSPlugin = require('less-plugin-clean-css')
|
||||
const ESLintPlugin = require('eslint-webpack-plugin')
|
||||
|
||||
const vueLoaderConfig = require('../vue-loader.config')
|
||||
@@ -12,44 +13,26 @@ const isDev = process.env.NODE_ENV === 'development'
|
||||
module.exports = {
|
||||
target: 'electron-renderer',
|
||||
entry: {
|
||||
renderer: path.join(__dirname, '../../src/renderer/main.ts'),
|
||||
renderer: path.join(__dirname, '../../src/renderer/main.js'),
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
library: {
|
||||
type: 'commonjs2',
|
||||
},
|
||||
path: path.join(__dirname, '../../dist'),
|
||||
libraryTarget: 'commonjs2',
|
||||
path: path.join(__dirname, '../../dist/electron'),
|
||||
publicPath: 'auto',
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.join(__dirname, '../../src'),
|
||||
'@main': path.join(__dirname, '../../src/main'),
|
||||
'@renderer': path.join(__dirname, '../../src/renderer'),
|
||||
'@lyric': path.join(__dirname, '../../src/renderer-lyric'),
|
||||
'@static': path.join(__dirname, '../../src/static'),
|
||||
'@common': path.join(__dirname, '../../src/common'),
|
||||
},
|
||||
extensions: ['.tsx', '.ts', '.js', '.json', '.vue', '.node'],
|
||||
extensions: ['*', '.js', '.json', '.vue', '.node'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'ts-loader',
|
||||
options: {
|
||||
appendTsSuffixTo: [/\.vue$/],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.node$/,
|
||||
use: 'node-loader',
|
||||
@@ -60,8 +43,9 @@ module.exports = {
|
||||
options: vueLoaderConfig,
|
||||
},
|
||||
{
|
||||
test: /\.pug$/,
|
||||
loader: 'pug-plain-loader',
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
@@ -73,12 +57,30 @@ module.exports = {
|
||||
loader: 'less-loader',
|
||||
options: {
|
||||
sourceMap: true,
|
||||
lessOptions: {
|
||||
plugins: [
|
||||
new CleanCSSPlugin({ advanced: true }),
|
||||
],
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
{
|
||||
test: /\.pug$/,
|
||||
oneOf: [
|
||||
// Use pug-plain-loader handle .vue file
|
||||
{
|
||||
resourceQuery: /vue/,
|
||||
use: ['pug-plain-loader'],
|
||||
},
|
||||
// Use pug-loader handle .pug file
|
||||
{
|
||||
use: ['pug-loader'],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||
exclude: path.join(__dirname, '../../src/renderer/assets/svgs'),
|
||||
type: 'asset',
|
||||
parser: {
|
||||
dataUrlCondition: {
|
||||
@@ -90,21 +92,7 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.svg$/,
|
||||
include: path.join(__dirname, '../../src/renderer/assets/svgs'),
|
||||
use: [
|
||||
{
|
||||
loader: 'svg-sprite-loader',
|
||||
options: {
|
||||
symbolId: 'icon-[name]',
|
||||
},
|
||||
},
|
||||
'svg-transform-loader',
|
||||
'svgo-loader',
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)$/,
|
||||
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
|
||||
type: 'asset',
|
||||
parser: {
|
||||
dataUrlCondition: {
|
||||
@@ -129,12 +117,16 @@ module.exports = {
|
||||
},
|
||||
],
|
||||
},
|
||||
performance: {
|
||||
maxEntrypointSize: 300000,
|
||||
},
|
||||
plugins: [
|
||||
new HTMLPlugin({
|
||||
filename: 'index.html',
|
||||
template: path.join(__dirname, '../../src/renderer/index.html'),
|
||||
template: path.join(__dirname, '../../src/renderer/index.pug'),
|
||||
isProd: process.env.NODE_ENV == 'production',
|
||||
browser: process.browser,
|
||||
scriptLoading: 'blocking',
|
||||
__dirname,
|
||||
}),
|
||||
new VueLoaderPlugin(),
|
||||
@@ -146,7 +138,6 @@ module.exports = {
|
||||
}),
|
||||
new ESLintPlugin({
|
||||
extensions: ['js', 'vue'],
|
||||
formatter: require('eslint-formatter-friendly'),
|
||||
}),
|
||||
],
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
|
||||
|
||||
const { merge } = require('webpack-merge')
|
||||
|
||||
@@ -9,15 +10,14 @@ module.exports = merge(baseConfig, {
|
||||
mode: 'development',
|
||||
devtool: 'eval-source-map',
|
||||
plugins: [
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new FriendlyErrorsPlugin(),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: '"development"',
|
||||
ELECTRON_DISABLE_SECURITY_WARNINGS: 'true',
|
||||
},
|
||||
// ENVIRONMENT: 'process.env',
|
||||
__VUE_OPTIONS_API__: 'true',
|
||||
__VUE_PROD_DEVTOOLS__: 'false',
|
||||
staticPath: `"${path.join(__dirname, '../../src/static').replace(/\\/g, '\\\\')}"`,
|
||||
__static: `"${path.join(__dirname, '../../src/static').replace(/\\/g, '\\\\')}"`,
|
||||
}),
|
||||
],
|
||||
performance: {
|
||||
|
||||
@@ -6,25 +6,24 @@ const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const { merge } = require('webpack-merge')
|
||||
|
||||
const baseConfig = require('./webpack.config.base')
|
||||
const buildConfig = require('../webpack-build-config')
|
||||
|
||||
// const { dependencies } = require('../../package.json')
|
||||
const { dependencies } = require('../../package.json')
|
||||
|
||||
// let whiteListedModules = ['vue', 'vue-router', 'vuex', 'vue-i18n']
|
||||
let whiteListedModules = ['vue']
|
||||
|
||||
|
||||
module.exports = merge(baseConfig, {
|
||||
mode: 'production',
|
||||
devtool: false,
|
||||
externals: [
|
||||
// ...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d)),
|
||||
...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d)),
|
||||
],
|
||||
plugins: [
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: path.join(__dirname, '../../src/static'),
|
||||
to: path.join(__dirname, '../../dist/static'),
|
||||
to: path.join(__dirname, '../../dist/electron/static'),
|
||||
},
|
||||
],
|
||||
}),
|
||||
@@ -32,25 +31,15 @@ module.exports = merge(baseConfig, {
|
||||
'process.env': {
|
||||
NODE_ENV: '"production"',
|
||||
},
|
||||
// ENVIRONMENT: 'process.env',
|
||||
__VUE_OPTIONS_API__: 'true',
|
||||
__VUE_PROD_DEVTOOLS__: 'false',
|
||||
}),
|
||||
],
|
||||
optimization: {
|
||||
minimize: buildConfig.minimize,
|
||||
minimizer: [
|
||||
new TerserPlugin(),
|
||||
new CssMinimizerPlugin(),
|
||||
],
|
||||
splitChunks: {
|
||||
chunks: 'initial',
|
||||
minChunks: 2,
|
||||
},
|
||||
},
|
||||
performance: {
|
||||
maxEntrypointSize: 1024 * 1024 * 10,
|
||||
maxAssetSize: 1024 * 1024 * 20,
|
||||
hints: 'warning',
|
||||
},
|
||||
node: {
|
||||
|
||||
@@ -13,9 +13,6 @@ const webpackHotMiddleware = require('webpack-hot-middleware')
|
||||
const mainConfig = require('./main/webpack.config.dev')
|
||||
const rendererConfig = require('./renderer/webpack.config.dev')
|
||||
const rendererLyricConfig = require('./renderer-lyric/webpack.config.dev')
|
||||
const rendererScriptConfig = require('./renderer-scripts/webpack.config.dev')
|
||||
const { Arch } = require('electron-builder')
|
||||
const replaceLib = require('./build-before-pack')
|
||||
|
||||
let electronProcess = null
|
||||
let manualRestart = false
|
||||
@@ -46,27 +43,27 @@ function startRenderer() {
|
||||
// // logStats('Renderer', stats)
|
||||
// })
|
||||
|
||||
const server = new WebpackDevServer({
|
||||
port: 9080,
|
||||
hot: true,
|
||||
historyApiFallback: true,
|
||||
static: {
|
||||
directory: path.join(__dirname, '../src/common/theme/images'),
|
||||
publicPath: '/theme_images',
|
||||
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()
|
||||
})
|
||||
},
|
||||
},
|
||||
client: {
|
||||
logging: 'warn',
|
||||
overlay: true,
|
||||
},
|
||||
setupMiddlewares(middlewares, devServer) {
|
||||
devServer.app.use(hotMiddlewareRenderer)
|
||||
devServer.middleware.waitUntilValid(resolve)
|
||||
)
|
||||
|
||||
return middlewares
|
||||
},
|
||||
}, compiler)
|
||||
|
||||
server.start()
|
||||
server.listen(9080)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -93,41 +90,27 @@ function startRendererLyric() {
|
||||
// // logStats('Renderer', stats)
|
||||
// })
|
||||
|
||||
const server = new WebpackDevServer({
|
||||
port: 9081,
|
||||
hot: true,
|
||||
historyApiFallback: true,
|
||||
// static: {
|
||||
// directory: path.join(__dirname, '../'),
|
||||
// },
|
||||
client: {
|
||||
logging: 'warn',
|
||||
overlay: true,
|
||||
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()
|
||||
})
|
||||
},
|
||||
},
|
||||
setupMiddlewares(middlewares, devServer) {
|
||||
devServer.app.use(hotMiddlewareRenderer)
|
||||
devServer.middleware.waitUntilValid(resolve)
|
||||
return middlewares
|
||||
},
|
||||
}, compiler)
|
||||
)
|
||||
|
||||
server.start()
|
||||
})
|
||||
}
|
||||
|
||||
function startRendererScripts() {
|
||||
return new Promise((resolve, reject) => {
|
||||
// mainConfig.entry.main = [path.join(__dirname, '../src/main/index.dev.js')].concat(mainConfig.entry.main)
|
||||
// mainConfig.mode = 'development'
|
||||
const compiler = webpack(rendererScriptConfig)
|
||||
|
||||
compiler.watch({}, (err, stats) => {
|
||||
if (err) {
|
||||
console.log(err)
|
||||
return
|
||||
}
|
||||
resolve()
|
||||
})
|
||||
server.listen(9081)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -171,7 +154,7 @@ function startElectron() {
|
||||
let args = [
|
||||
'--inspect=5858',
|
||||
// 'NODE_ENV=development',
|
||||
path.join(__dirname, '../dist/main.js'),
|
||||
path.join(__dirname, '../dist/electron/main.js'),
|
||||
]
|
||||
|
||||
// detect yarn or npm and process commandline args accordingly
|
||||
@@ -195,19 +178,11 @@ function startElectron() {
|
||||
})
|
||||
}
|
||||
|
||||
const logs = [
|
||||
'Manifest version 2 is deprecated, and support will be removed in 2023',
|
||||
'"Extension server error: Operation failed: Permission denied", source: devtools://devtools/bundled',
|
||||
|
||||
// https://github.com/electron/electron/issues/32133
|
||||
'"Electron sandbox_bundle.js script failed to run"',
|
||||
'"TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))",',
|
||||
]
|
||||
function electronLog(data, color) {
|
||||
let log = data.toString()
|
||||
if (/[0-9A-z]+/.test(log)) {
|
||||
// 抑制某些无关的报错日志
|
||||
if (color == 'red' && typeof log === 'string' && logs.some(l => log.includes(l))) return
|
||||
// 抑制 user api 窗口使用 data url 加载页面时 vue扩展 的报错日志刷屏的问题
|
||||
if (color == 'red' && typeof log === 'string' && log.includes('"Extension server error: Operation failed: Permission denied", source: devtools://devtools/bundled/extensions/extensions.js')) return
|
||||
|
||||
console.log(chalk[color](log))
|
||||
}
|
||||
@@ -219,28 +194,16 @@ function init() {
|
||||
spinners.add('main', { text: 'main compiling' })
|
||||
spinners.add('renderer', { text: 'renderer compiling' })
|
||||
spinners.add('renderer-lyric', { text: 'renderer-lyric compiling' })
|
||||
spinners.add('renderer-scripts', { text: 'renderer-scripts compiling' })
|
||||
function handleSuccess(name) {
|
||||
spinners.succeed(name, { text: name + ' compile success!' })
|
||||
}
|
||||
function handleFail(name) {
|
||||
spinners.fail(name, { text: name + ' compile fail!' })
|
||||
}
|
||||
replaceLib({ electronPlatformName: process.platform, arch: Arch[process.arch] })
|
||||
|
||||
Promise.all([
|
||||
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')
|
||||
}),
|
||||
startRendererScripts().then(() => handleSuccess('renderer-scripts')).catch((err) => {
|
||||
console.error(err.message)
|
||||
return handleFail('renderer-scripts')
|
||||
}),
|
||||
startRenderer().then(() => handleSuccess('renderer')).catch(() => handleFail('renderer')),
|
||||
startRendererLyric().then(() => handleSuccess('renderer-lyric')).catch(() => handleFail('renderer-lyric')),
|
||||
startMain().then(() => handleSuccess('main')).catch(() => handleFail('main')),
|
||||
]).then(startElectron).catch(err => {
|
||||
console.error(err)
|
||||
|
||||
34042
package-lock.json
generated
34042
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
229
package.json
229
package.json
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "lx-music-desktop",
|
||||
"version": "2.3.0-beta.3",
|
||||
"version": "1.15.2",
|
||||
"description": "一个免费的音乐查找助手",
|
||||
"main": "./dist/main.js",
|
||||
"main": "./dist/electron/main.js",
|
||||
"productName": "lx-music-desktop",
|
||||
"scripts": {
|
||||
"pack": "node build-config/pack.js && npm run pack:win:setup:x64",
|
||||
@@ -21,8 +21,9 @@
|
||||
"pack:win:7z:arm64": "cross-env TARGET=green ARCH=win_arm64 electron-builder -w=7z --arm64 -p never",
|
||||
"pack:linux": "node build-config/pack.js && npm run pack:linux:deb && npm run pack:linux:appImage && npm run pack:linux:rpm && npm run pack:linux:pacman",
|
||||
"pack:linux:appImage": "cross-env ARCH=x64 electron-builder -l=AppImage -p never",
|
||||
"pack:linux:deb": "npm run pack:linux:deb:x64 && npm run pack:linux:deb:arm64 && npm run pack:linux:deb:armv7l",
|
||||
"pack:linux:deb": "npm run pack:linux:deb:x64 && npm run pack:linux:deb:x86 && npm run pack:linux:deb:arm64 && npm run pack:linux:deb:armv7l",
|
||||
"pack:linux:deb:x64": "cross-env ARCH=x64 electron-builder -l=deb --x64 -p never",
|
||||
"pack:linux:deb:x86": "cross-env ARCH=x86 electron-builder -l=deb --ia32 -p never",
|
||||
"pack:linux:deb:arm64": "cross-env ARCH=arm64 electron-builder -l=deb --arm64 -p never",
|
||||
"pack:linux:deb:armv7l": "cross-env ARCH=armv7l electron-builder -l=deb --armv7l -p never",
|
||||
"pack:linux:rpm": "cross-env ARCH=x64 electron-builder -l=rpm --x64 -p never",
|
||||
@@ -49,59 +50,39 @@
|
||||
"publish:mac:dmg:arm64": "electron-builder -m=dmg --arm64 -p onTagOrDraft",
|
||||
"publish:linux:deb:x64:always": "cross-env ARCH=x64 electron-builder -l=deb --x64 -p always",
|
||||
"publish:linux:deb:x64": "cross-env ARCH=x64 electron-builder -l=deb --x64 -p onTagOrDraft",
|
||||
"publish:linux:deb:x86": "cross-env ARCH=x86 electron-builder -l=deb --ia32 -p onTagOrDraft",
|
||||
"publish:linux:deb:arm64": "cross-env ARCH=arm64 electron-builder -l=deb --arm64 -p onTagOrDraft",
|
||||
"publish:linux:deb:armv7l": "cross-env ARCH=armv7l electron-builder -l=deb --armv7l -p onTagOrDraft",
|
||||
"publish:linux:appImage": "cross-env ARCH=x64 electron-builder -l=AppImage -p onTagOrDraft",
|
||||
"publish:linux:rpm": "cross-env ARCH=x64 electron-builder -l=rpm --x64 -p onTagOrDraft",
|
||||
"publish:linux:pacman": "cross-env ARCH=x64 electron-builder -l=pacman --x64 -p onTagOrDraft",
|
||||
"dev": "cross-env NODE_OPTIONS=--max-http-header-size=200000 node build-config/runner-dev.js",
|
||||
"clean:electron": "rimraf dist",
|
||||
"dev": "node build-config/runner-dev.js",
|
||||
"clean:electron": "rimraf dist/electron",
|
||||
"clean": "rimraf dist && rimraf build",
|
||||
"build:theme": "node src/common/theme/createThemes.js",
|
||||
"build:src": "node build-config/pack.js",
|
||||
"build:main": "cross-env NODE_ENV=production webpack --config build-config/main/webpack.config.prod.js --progress",
|
||||
"build:renderer": "cross-env NODE_ENV=production webpack --config build-config/renderer/webpack.config.prod.js --progress",
|
||||
"build:renderer-lyric": "cross-env NODE_ENV=production webpack --config build-config/renderer-lyric/webpack.config.prod.js --progress",
|
||||
"build:renderer-scripts": "cross-env NODE_ENV=production webpack --config build-config/renderer-scripts/webpack.config.prod.js --progress",
|
||||
"build": "npm run clean:electron && npm run build:main && npm run build:renderer && npm run build:renderer-lyric && npm run build:renderer-scripts",
|
||||
"lint": "eslint --ext .ts,.js,.vue -f node_modules/eslint-formatter-friendly src",
|
||||
"lint:fix": "eslint --ext .ts,.js,.vue -f node_modules/eslint-formatter-friendly --fix src",
|
||||
"postinstall": "electron-builder install-app-deps",
|
||||
"dp": "cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=http://127.0.0.1:1081 npm run pack",
|
||||
"up": "cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=http://127.0.0.1:1081 npm i"
|
||||
"build": "npm run clean:electron && npm run build:main && npm run build:renderer && npm run build:renderer-lyric",
|
||||
"lint": "eslint --ext .js,.vue -f ./node_modules/eslint-formatter-friendly src",
|
||||
"lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-formatter-friendly --fix src",
|
||||
"dp": "cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=http://localhost:1081 npm run pack",
|
||||
"up": "cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=http://localhost:1081 npm i"
|
||||
},
|
||||
"browserslist": [
|
||||
"Electron 22.3.0"
|
||||
"Electron 15.2.0"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 16",
|
||||
"npm": ">=8.5.2"
|
||||
"node": ">= 14"
|
||||
},
|
||||
"build": {
|
||||
"appId": "cn.toside.music.desktop",
|
||||
"beforePack": "./build-config/build-before-pack.js",
|
||||
"afterPack": "./build-config/build-after-pack.js",
|
||||
"protocols": {
|
||||
"name": "lx-music-protocol",
|
||||
"schemes": [
|
||||
"lxmusic"
|
||||
]
|
||||
},
|
||||
"directories": {
|
||||
"buildResources": "./resources",
|
||||
"output": "./build"
|
||||
},
|
||||
"files": [
|
||||
"!node_modules/**/*",
|
||||
"node_modules/font-list",
|
||||
"node_modules/better-sqlite3/lib",
|
||||
"node_modules/better-sqlite3/package.json",
|
||||
"node_modules/better-sqlite3/build/Release/better_sqlite3.node",
|
||||
"node_modules/node-gyp-build",
|
||||
"node_modules/bufferutil",
|
||||
"node_modules/utf-8-validate",
|
||||
"build/Release/qrc_decode.node",
|
||||
"dist/**/*"
|
||||
"dist/electron/**/*"
|
||||
],
|
||||
"asar": {
|
||||
"smartUnpack": false
|
||||
@@ -124,12 +105,7 @@
|
||||
"icon": "./resources/icons",
|
||||
"category": "Utility;AudioVideo;Audio;Player;Music;",
|
||||
"desktop": {
|
||||
"Name": "LX Music",
|
||||
"Name[zh_CN]": "LX Music",
|
||||
"Name[zh_TW]": "LX Music",
|
||||
"Encoding": "UTF-8",
|
||||
"MimeType": "x-scheme-handler/lxmusic",
|
||||
"StartupNotify": "false"
|
||||
"Name[zh_CN]": "洛雪音乐助手"
|
||||
}
|
||||
},
|
||||
"nsis": {
|
||||
@@ -172,20 +148,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"macLanguagesInfoPlistStrings": {
|
||||
"en": {
|
||||
"CFBundleDisplayName": "LX Music",
|
||||
"CFBundleName": "LX Music"
|
||||
},
|
||||
"zh_CN": {
|
||||
"CFBundleDisplayName": "LX Music",
|
||||
"CFBundleName": "LX Music"
|
||||
},
|
||||
"zh_TW": {
|
||||
"CFBundleDisplayName": "LX Music",
|
||||
"CFBundleName": "LX Music"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/lyswhut/lx-music-desktop.git"
|
||||
@@ -193,7 +155,7 @@
|
||||
"keywords": [
|
||||
"music-player",
|
||||
"electron-app",
|
||||
"vuejs3"
|
||||
"vuejs2"
|
||||
],
|
||||
"author": {
|
||||
"name": "lyswhut",
|
||||
@@ -205,107 +167,88 @@
|
||||
},
|
||||
"homepage": "https://github.com/lyswhut/lx-music-desktop#readme",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.21.8",
|
||||
"@babel/eslint-parser": "^7.21.8",
|
||||
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
||||
"@babel/core": "^7.16.0",
|
||||
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||
"@babel/plugin-transform-modules-umd": "^7.18.6",
|
||||
"@babel/plugin-transform-runtime": "^7.21.4",
|
||||
"@babel/preset-env": "^7.21.5",
|
||||
"@babel/preset-typescript": "^7.21.5",
|
||||
"@types/better-sqlite3": "^7.6.4",
|
||||
"@types/needle": "^3.2.0",
|
||||
"@types/tunnel": "^0.0.3",
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
||||
"@typescript-eslint/parser": "^5.59.2",
|
||||
"@volar/vue-language-plugin-pug": "^1.6.4",
|
||||
"babel-loader": "^9.1.2",
|
||||
"browserslist": "^4.21.5",
|
||||
"@babel/plugin-transform-modules-umd": "^7.16.0",
|
||||
"@babel/plugin-transform-runtime": "^7.16.0",
|
||||
"@babel/polyfill": "^7.12.1",
|
||||
"@babel/preset-env": "^7.16.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"babel-loader": "^8.2.3",
|
||||
"babel-preset-minify": "^0.5.1",
|
||||
"browserslist": "^4.17.6",
|
||||
"cfonts": "^2.10.0",
|
||||
"chalk": "^4.1.2",
|
||||
"changelog-parser": "^3.0.1",
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
"core-js": "^3.30.2",
|
||||
"changelog-parser": "^2.8.0",
|
||||
"copy-webpack-plugin": "^9.0.1",
|
||||
"core-js": "^3.19.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^6.7.3",
|
||||
"css-minimizer-webpack-plugin": "^5.0.0",
|
||||
"del": "^6.1.1",
|
||||
"electron": "^22.3.8",
|
||||
"electron-builder": "^24.3.0",
|
||||
"css-loader": "^6.5.1",
|
||||
"css-minimizer-webpack-plugin": "^3.1.2",
|
||||
"del": "^6.0.0",
|
||||
"electron": "^13.4.0",
|
||||
"electron-builder": "^22.11.7",
|
||||
"electron-debug": "^3.2.0",
|
||||
"electron-devtools-installer": "^3.2.0",
|
||||
"electron-to-chromium": "^1.4.385",
|
||||
"electron-updater": "^6.1.0",
|
||||
"eslint": "^8.40.0",
|
||||
"eslint-config-standard": "^17.0.0",
|
||||
"eslint-config-standard-with-typescript": "^34.0.1",
|
||||
"eslint-formatter-friendly": "github:lyswhut/eslint-friendly-formatter#2170d1320e2fad13615a9dcf229669f0bb473a53",
|
||||
"eslint-plugin-html": "^7.1.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-n": "^15.7.0",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"eslint-plugin-vue": "^9.11.1",
|
||||
"eslint-webpack-plugin": "^4.0.1",
|
||||
"html-webpack-plugin": "^5.5.1",
|
||||
"less": "^4.1.3",
|
||||
"less-loader": "^11.1.0",
|
||||
"mini-css-extract-plugin": "^2.7.5",
|
||||
"electron-to-chromium": "^1.3.891",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-standard": "^16.0.3",
|
||||
"eslint-formatter-friendly": "^7.0.0",
|
||||
"eslint-plugin-html": "^6.2.0",
|
||||
"eslint-plugin-import": "^2.25.2",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^5.1.1",
|
||||
"eslint-plugin-standard": "^4.1.0",
|
||||
"eslint-webpack-plugin": "^3.1.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"friendly-errors-webpack-plugin": "^1.7.0",
|
||||
"html-webpack-plugin": "^5.5.0",
|
||||
"less": "^4.1.2",
|
||||
"less-loader": "^10.2.0",
|
||||
"less-plugin-clean-css": "^1.5.1",
|
||||
"markdown-it": "^12.2.0",
|
||||
"mini-css-extract-plugin": "^2.4.4",
|
||||
"node-loader": "^2.0.0",
|
||||
"postcss": "^8.4.23",
|
||||
"postcss-loader": "^7.3.0",
|
||||
"postcss": "^8.3.11",
|
||||
"postcss-loader": "^6.2.0",
|
||||
"postcss-pxtorem": "^6.0.0",
|
||||
"pug": "^3.0.2",
|
||||
"pug-loader": "^2.4.0",
|
||||
"pug-plain-loader": "^1.1.0",
|
||||
"rimraf": "^5.0.0",
|
||||
"spinnies": "github:lyswhut/spinnies#233305c58694aa3b053e3ab9af9049993f918b9d",
|
||||
"svg-sprite-loader": "^6.0.11",
|
||||
"svg-transform-loader": "^2.0.13",
|
||||
"svgo-loader": "^4.0.0",
|
||||
"terser": "^5.17.1",
|
||||
"terser-webpack-plugin": "^5.3.8",
|
||||
"ts-loader": "^9.4.2",
|
||||
"typescript": "^5.0.4",
|
||||
"vue-eslint-parser": "^9.2.1",
|
||||
"vue-loader": "^17.1.0",
|
||||
"vue-template-compiler": "^2.7.14",
|
||||
"webpack": "^5.82.0",
|
||||
"webpack-cli": "^5.1.0",
|
||||
"webpack-dev-server": "^4.15.0",
|
||||
"webpack-hot-middleware": "github:lyswhut/webpack-hot-middleware#329c4375134b89d39da23a56a94db651247c74a1",
|
||||
"raw-loader": "^4.0.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"spinnies": "^0.5.1",
|
||||
"terser-webpack-plugin": "^5.2.5",
|
||||
"url-loader": "^4.1.1",
|
||||
"vue-loader": "^15.9.8",
|
||||
"vue-template-compiler": "^2.6.14",
|
||||
"webpack": "^5.62.1",
|
||||
"webpack-cli": "^4.9.1",
|
||||
"webpack-dev-server": "^3.11.2",
|
||||
"webpack-hot-middleware": "^2.25.1",
|
||||
"webpack-merge": "^5.8.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@simonwep/pickr": "^1.8.2",
|
||||
"better-sqlite3": "^8.3.0",
|
||||
"bufferutil": "^4.0.7",
|
||||
"comlink": "~4.3.1",
|
||||
"bufferutil": "^4.0.5",
|
||||
"crypto-js": "^4.1.1",
|
||||
"electron-log": "^4.4.8",
|
||||
"electron-store": "^8.1.0",
|
||||
"font-list": "^1.4.5",
|
||||
"electron-log": "^4.4.1",
|
||||
"electron-store": "^8.0.1",
|
||||
"electron-updater": "^4.3.9",
|
||||
"font-list": "git+https://github.com/lyswhut/node-font-list.git#2ed3b4ee42e8a43373e8a30d87760c840725843e",
|
||||
"http-terminator": "^3.0.3",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"image-size": "^1.0.2",
|
||||
"jschardet": "^3.0.0",
|
||||
"long": "^5.2.3",
|
||||
"music-metadata": "^8.1.4",
|
||||
"needle": "github:lyswhut/needle#93299ac841b7e9a9f82ca7279b88aaaeda404060",
|
||||
"node-id3": "^0.2.6",
|
||||
"sortablejs": "^1.15.0",
|
||||
"tunnel": "^0.0.6",
|
||||
"utf-8-validate": "^6.0.3",
|
||||
"vue": "^3.2.47",
|
||||
"vue-router": "^4.1.6",
|
||||
"ws": "^8.13.0"
|
||||
},
|
||||
"overrides": {
|
||||
"got": "^11",
|
||||
"json5": "latest",
|
||||
"minimatch": "latest",
|
||||
"svg-sprite-loader": {
|
||||
"postcss": "latest"
|
||||
},
|
||||
"svg-baker": {
|
||||
"postcss": "latest"
|
||||
},
|
||||
"http-cache-semantics": "latest"
|
||||
"image-size": "^1.0.0",
|
||||
"koa": "^2.13.4",
|
||||
"long": "^5.1.0",
|
||||
"needle": "^3.0.0",
|
||||
"node-id3": "^0.2.3",
|
||||
"request": "^2.88.2",
|
||||
"socket.io": "^4.3.2",
|
||||
"utf-8-validate": "^5.0.7",
|
||||
"vue": "^2.6.14",
|
||||
"vue-i18n": "^8.26.7",
|
||||
"vue-router": "^3.5.3",
|
||||
"vuex": "^3.6.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
### 新增
|
||||
|
||||
- 新增音效设置(实验性功能),支持10段均衡器设置、内置的一些环境混响音效、3D立体环绕音效
|
||||
|
||||
### 其他
|
||||
|
||||
- 更新 electron 到 v22.3.8
|
||||
- 降级electron到v13.4.0(这修复了windows 7下播放歌曲时软件会崩溃的问题)
|
||||
|
||||
@@ -9,12 +9,12 @@ const version_bak = JSON.stringify(version, null, 2)
|
||||
const parseChangelog = require('changelog-parser')
|
||||
const changelogPath = jp('../../CHANGELOG.md')
|
||||
|
||||
// const md_renderer = markdownStr => new (require('markdown-it'))({
|
||||
// html: true,
|
||||
// linkify: true,
|
||||
// typographer: true,
|
||||
// breaks: true,
|
||||
// }).render(markdownStr)
|
||||
const md_renderer = markdownStr => new (require('markdown-it'))({
|
||||
html: true,
|
||||
linkify: true,
|
||||
typographer: true,
|
||||
breaks: true,
|
||||
}).render(markdownStr)
|
||||
|
||||
const getPrevVer = () => parseChangelog(changelogPath).then(res => {
|
||||
if (!res.versions.length) throw new Error('CHANGELOG 无法解析到版本号')
|
||||
@@ -28,7 +28,7 @@ const updateChangeLog = async(newVerNum, newChangeLog) => {
|
||||
fs.writeFileSync(changelogPath, changeLog.replace(new RegExp('(## [?0.1.1]?)'), log + '\n$1'), 'utf-8')
|
||||
}
|
||||
|
||||
// const renderChangeLog = md => md_renderer(md)
|
||||
const renderChangeLog = md => md_renderer(md)
|
||||
|
||||
|
||||
module.exports = async newVerNum => {
|
||||
@@ -38,7 +38,7 @@ module.exports = async newVerNum => {
|
||||
newVerNum = verArr.join('.')
|
||||
}
|
||||
const newMDChangeLog = fs.readFileSync(jp('../changeLog.md'), 'utf-8')
|
||||
// const newChangeLog = renderChangeLog(newMDChangeLog)
|
||||
const newChangeLog = renderChangeLog(newMDChangeLog)
|
||||
version.history.unshift({
|
||||
version: version.version,
|
||||
desc: version.desc,
|
||||
@@ -58,7 +58,7 @@ module.exports = async newVerNum => {
|
||||
return {
|
||||
pkg_bak,
|
||||
version_bak,
|
||||
// changeLog: newChangeLog,
|
||||
changeLog: newChangeLog,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 166 KiB |
56
src/common/config.js
Normal file
56
src/common/config.js
Normal file
@@ -0,0 +1,56 @@
|
||||
module.exports = {
|
||||
windowSizeList: [
|
||||
{
|
||||
id: 0,
|
||||
name: 'smaller',
|
||||
width: 828,
|
||||
height: 530,
|
||||
fontSize: '14px',
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: 'small',
|
||||
width: 920,
|
||||
height: 590,
|
||||
fontSize: '16px',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'medium',
|
||||
width: 1018,
|
||||
height: 650,
|
||||
fontSize: '16px',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: 'big',
|
||||
width: 1114,
|
||||
height: 708,
|
||||
fontSize: '17px',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: 'larger',
|
||||
width: 1202,
|
||||
height: 766,
|
||||
fontSize: '17px',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: 'oversized',
|
||||
width: 1382,
|
||||
height: 886,
|
||||
fontSize: '18px',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: 'huge',
|
||||
width: 1686,
|
||||
height: 1062,
|
||||
fontSize: '19px',
|
||||
},
|
||||
],
|
||||
navigationUrlWhiteList: [
|
||||
|
||||
],
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
export interface WindowSize {
|
||||
id: number
|
||||
name: string
|
||||
width: number
|
||||
height: number
|
||||
}
|
||||
|
||||
export const windowSizeList: WindowSize[] = [
|
||||
{
|
||||
id: 0,
|
||||
name: 'smaller',
|
||||
width: 828,
|
||||
height: 540,
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: 'small',
|
||||
width: 920,
|
||||
height: 600,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'medium',
|
||||
width: 1020,
|
||||
height: 660,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: 'big',
|
||||
width: 1114,
|
||||
height: 718,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: 'larger',
|
||||
width: 1202,
|
||||
height: 776,
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: 'oversized',
|
||||
width: 1385,
|
||||
height: 896,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: 'huge',
|
||||
width: 1700,
|
||||
height: 1070,
|
||||
},
|
||||
]
|
||||
|
||||
export const navigationUrlWhiteList: RegExp[] = []
|
||||
|
||||
// 基础黑白色
|
||||
// export const commonColorNames = [
|
||||
// '--color-000', '--color-050', '--color-100', '--color-200', '--color-300', '--color-400',
|
||||
// '--color-500', '--color-600', '--color-700', '--color-800', '--color-900',
|
||||
// ] as const
|
||||
// export const commonLightColorValues = [
|
||||
// 'rgb(255, 255, 255)',
|
||||
// 'rgb(217,217,217)',
|
||||
// 'rgb(184,184,184)',
|
||||
// 'rgb(156,156,156)',
|
||||
// 'rgb(133,133,133)',
|
||||
// 'rgb(113,113,113)',
|
||||
// 'rgb(96,96,96)',
|
||||
// 'rgb(82,82,82)',
|
||||
// 'rgb(70,70,70)',
|
||||
// 'rgb(60,60,60)',
|
||||
// 'rgb(51,51,51)',
|
||||
// ] as const
|
||||
// export const commonDarkColorValues = [
|
||||
// 'rgb(11, 11, 11)',
|
||||
// 'rgb(60,60,60)',
|
||||
// 'rgb(99,99,99)',
|
||||
// 'rgb(130,130,130)',
|
||||
// 'rgb(155,155,155)',
|
||||
// 'rgb(175,175,175)',
|
||||
// 'rgb(191,191,191)',
|
||||
// 'rgb(204,204,204)',
|
||||
// 'rgb(214,214,214)',
|
||||
// 'rgb(222,222,222)',
|
||||
// 'rgb(229,229,229)',
|
||||
// ] as const
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
export const URL_SCHEME_RXP = /^lxmusic:\/\//
|
||||
|
||||
|
||||
export const STORE_NAMES = {
|
||||
APP_SETTINGS: 'config_v2',
|
||||
DATA: 'data',
|
||||
SYNC: 'sync',
|
||||
HOTKEY: 'hot_key',
|
||||
USER_API: 'user_api',
|
||||
LRC_RAW: 'lyrics',
|
||||
LRC_EDITED: 'lyrics_edited',
|
||||
THEME: 'theme',
|
||||
SOUND_EFFECT: 'sound_effect',
|
||||
} as const
|
||||
|
||||
export const APP_EVENT_NAMES = {
|
||||
winMainName: 'win_main',
|
||||
winLyricName: 'win_lyric',
|
||||
trayName: 'tray',
|
||||
} as const
|
||||
|
||||
export const LIST_IDS = {
|
||||
DEFAULT: 'default',
|
||||
LOVE: 'love',
|
||||
TEMP: 'temp',
|
||||
DOWNLOAD: 'download',
|
||||
PLAY_LATER: null,
|
||||
} as const
|
||||
|
||||
export const DATA_KEYS = {
|
||||
viewPrevState: 'viewPrevState',
|
||||
playInfo: 'playInfo',
|
||||
searchHistoryList: 'searchHistoryList',
|
||||
listScrollPosition: 'listScrollPosition',
|
||||
listPrevSelectId: 'listPrevSelectId',
|
||||
listUpdateInfo: 'listUpdateInfo',
|
||||
ignoreVersion: 'ignoreVersion',
|
||||
|
||||
leaderboardSetting: 'leaderboardSetting',
|
||||
songListSetting: 'songListSetting',
|
||||
searchSetting: 'searchSetting',
|
||||
|
||||
lastStartInfo: 'lastStartInfo',
|
||||
} as const
|
||||
|
||||
export const DEFAULT_SETTING = {
|
||||
leaderboard: {
|
||||
source: 'kw',
|
||||
boardId: 'kw__16',
|
||||
},
|
||||
|
||||
songList: {
|
||||
source: 'kg',
|
||||
sortId: '5',
|
||||
tagId: '',
|
||||
},
|
||||
|
||||
search: {
|
||||
temp_source: 'kw',
|
||||
source: 'all',
|
||||
type: 'music',
|
||||
},
|
||||
|
||||
viewPrevState: {
|
||||
url: '/search',
|
||||
query: {},
|
||||
},
|
||||
}
|
||||
|
||||
export const DOWNLOAD_STATUS = {
|
||||
RUN: 'run',
|
||||
WAITING: 'waiting',
|
||||
PAUSE: 'pause',
|
||||
ERROR: 'error',
|
||||
COMPLETED: 'completed',
|
||||
} as const
|
||||
|
||||
export const QUALITYS = ['flac24bit', 'flac', 'wav', 'ape', '320k', '192k', '128k'] as const
|
||||
|
||||
export const SYNC_CODE = {
|
||||
helloMsg: 'Hello~::^-^::~v3~',
|
||||
idPrefix: 'OjppZDo6',
|
||||
authMsg: 'lx-music auth::',
|
||||
authFailed: 'Auth failed',
|
||||
missingAuthCode: 'Missing auth code',
|
||||
getServiceIdFailed: 'Get service id failed',
|
||||
connectServiceFailed: 'Connect service failed',
|
||||
connecting: 'Connecting...',
|
||||
unknownServiceAddress: 'Unknown service address',
|
||||
msgBlockedIp: 'Blocked IP',
|
||||
msgConnect: 'lx-music connect',
|
||||
msgAuthFailed: 'Auth failed',
|
||||
} as const
|
||||
|
||||
export const SYNC_CLOSE_CODE = {
|
||||
normal: 1000,
|
||||
failed: 4100,
|
||||
} as const
|
||||
|
||||
89
src/common/defaultHotKey.js
Normal file
89
src/common/defaultHotKey.js
Normal file
@@ -0,0 +1,89 @@
|
||||
const { player: hotKeyPlayer, common: hotKeyCommon, desktop_lyric: hotKeyDesktopLyric } = require('./hotKey')
|
||||
|
||||
module.exports = {
|
||||
local: {
|
||||
enable: true,
|
||||
keys: {
|
||||
'mod+f5': {
|
||||
type: hotKeyPlayer.toggle_play.type,
|
||||
name: hotKeyPlayer.toggle_play.name,
|
||||
action: hotKeyPlayer.toggle_play.action,
|
||||
},
|
||||
'mod+arrowleft': {
|
||||
type: hotKeyPlayer.prev.type,
|
||||
name: hotKeyPlayer.prev.name,
|
||||
action: hotKeyPlayer.prev.action,
|
||||
},
|
||||
'mod+arrowright': {
|
||||
type: hotKeyPlayer.next.type,
|
||||
name: hotKeyPlayer.next.name,
|
||||
action: hotKeyPlayer.next.action,
|
||||
},
|
||||
f1: {
|
||||
type: hotKeyCommon.focusSearchInput.type,
|
||||
name: hotKeyCommon.focusSearchInput.name,
|
||||
action: hotKeyCommon.focusSearchInput.action,
|
||||
},
|
||||
},
|
||||
},
|
||||
global: {
|
||||
enable: false,
|
||||
keys: {
|
||||
MediaPlayPause: {
|
||||
type: hotKeyPlayer.toggle_play.type,
|
||||
name: null,
|
||||
action: hotKeyPlayer.toggle_play.action,
|
||||
},
|
||||
MediaPreviousTrack: {
|
||||
type: hotKeyPlayer.prev.type,
|
||||
name: null,
|
||||
action: hotKeyPlayer.prev.action,
|
||||
},
|
||||
MediaNextTrack: {
|
||||
type: hotKeyPlayer.next.type,
|
||||
name: null,
|
||||
action: hotKeyPlayer.next.action,
|
||||
},
|
||||
'mod+alt+f5': {
|
||||
type: hotKeyPlayer.toggle_play.type,
|
||||
name: hotKeyPlayer.toggle_play.name,
|
||||
action: hotKeyPlayer.toggle_play.action,
|
||||
},
|
||||
'mod+alt+arrowleft': {
|
||||
type: hotKeyPlayer.prev.type,
|
||||
name: hotKeyPlayer.prev.name,
|
||||
action: hotKeyPlayer.prev.action,
|
||||
},
|
||||
'mod+alt+arrowright': {
|
||||
type: hotKeyPlayer.next.type,
|
||||
name: hotKeyPlayer.next.name,
|
||||
action: hotKeyPlayer.next.action,
|
||||
},
|
||||
'mod+alt+arrowup': {
|
||||
type: hotKeyPlayer.volume_up.type,
|
||||
name: hotKeyPlayer.volume_up.name,
|
||||
action: hotKeyPlayer.volume_up.action,
|
||||
},
|
||||
'mod+alt+arrowdown': {
|
||||
type: hotKeyPlayer.volume_down.type,
|
||||
name: hotKeyPlayer.volume_down.name,
|
||||
action: hotKeyPlayer.volume_down.action,
|
||||
},
|
||||
'mod+alt+0': {
|
||||
type: hotKeyDesktopLyric.toggle_visible.type,
|
||||
name: hotKeyDesktopLyric.toggle_visible.name,
|
||||
action: hotKeyDesktopLyric.toggle_visible.action,
|
||||
},
|
||||
'mod+alt+-': {
|
||||
type: hotKeyDesktopLyric.toggle_lock.type,
|
||||
name: hotKeyDesktopLyric.toggle_lock.name,
|
||||
action: hotKeyDesktopLyric.toggle_lock.action,
|
||||
},
|
||||
'mod+alt+=': {
|
||||
type: hotKeyDesktopLyric.toggle_always_top.type,
|
||||
name: hotKeyDesktopLyric.toggle_always_top.name,
|
||||
action: hotKeyDesktopLyric.toggle_always_top.action,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
import { HOTKEY_PLAYER, HOTKEY_COMMON, HOTKEY_DESKTOP_LYRIC } from './hotKey'
|
||||
|
||||
const local: LX.HotKeyConfig = {
|
||||
enable: true,
|
||||
keys: {
|
||||
'mod+f5': {
|
||||
type: HOTKEY_PLAYER.toggle_play.type,
|
||||
name: HOTKEY_PLAYER.toggle_play.name,
|
||||
action: HOTKEY_PLAYER.toggle_play.action,
|
||||
},
|
||||
'mod+arrowleft': {
|
||||
type: HOTKEY_PLAYER.prev.type,
|
||||
name: HOTKEY_PLAYER.prev.name,
|
||||
action: HOTKEY_PLAYER.prev.action,
|
||||
},
|
||||
'mod+arrowright': {
|
||||
type: HOTKEY_PLAYER.next.type,
|
||||
name: HOTKEY_PLAYER.next.name,
|
||||
action: HOTKEY_PLAYER.next.action,
|
||||
},
|
||||
f1: {
|
||||
type: HOTKEY_COMMON.focusSearchInput.type,
|
||||
name: HOTKEY_COMMON.focusSearchInput.name,
|
||||
action: HOTKEY_COMMON.focusSearchInput.action,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const global: LX.HotKeyConfig = {
|
||||
enable: false,
|
||||
keys: {
|
||||
// MediaPlayPause: {
|
||||
// type: HOTKEY_PLAYER.toggle_play.type,
|
||||
// name: '',
|
||||
// action: HOTKEY_PLAYER.toggle_play.action,
|
||||
// },
|
||||
// MediaPreviousTrack: {
|
||||
// type: HOTKEY_PLAYER.prev.type,
|
||||
// name: '',
|
||||
// action: HOTKEY_PLAYER.prev.action,
|
||||
// },
|
||||
// MediaNextTrack: {
|
||||
// type: HOTKEY_PLAYER.next.type,
|
||||
// name: '',
|
||||
// action: HOTKEY_PLAYER.next.action,
|
||||
// },
|
||||
'mod+alt+f5': {
|
||||
type: HOTKEY_PLAYER.toggle_play.type,
|
||||
name: HOTKEY_PLAYER.toggle_play.name,
|
||||
action: HOTKEY_PLAYER.toggle_play.action,
|
||||
},
|
||||
'mod+alt+arrowleft': {
|
||||
type: HOTKEY_PLAYER.prev.type,
|
||||
name: HOTKEY_PLAYER.prev.name,
|
||||
action: HOTKEY_PLAYER.prev.action,
|
||||
},
|
||||
'mod+alt+arrowright': {
|
||||
type: HOTKEY_PLAYER.next.type,
|
||||
name: HOTKEY_PLAYER.next.name,
|
||||
action: HOTKEY_PLAYER.next.action,
|
||||
},
|
||||
'mod+alt+arrowup': {
|
||||
type: HOTKEY_PLAYER.volume_up.type,
|
||||
name: HOTKEY_PLAYER.volume_up.name,
|
||||
action: HOTKEY_PLAYER.volume_up.action,
|
||||
},
|
||||
'mod+alt+arrowdown': {
|
||||
type: HOTKEY_PLAYER.volume_down.type,
|
||||
name: HOTKEY_PLAYER.volume_down.name,
|
||||
action: HOTKEY_PLAYER.volume_down.action,
|
||||
},
|
||||
'mod+alt+0': {
|
||||
type: HOTKEY_DESKTOP_LYRIC.toggle_visible.type,
|
||||
name: HOTKEY_DESKTOP_LYRIC.toggle_visible.name,
|
||||
action: HOTKEY_DESKTOP_LYRIC.toggle_visible.action,
|
||||
},
|
||||
'mod+alt+-': {
|
||||
type: HOTKEY_DESKTOP_LYRIC.toggle_lock.type,
|
||||
name: HOTKEY_DESKTOP_LYRIC.toggle_lock.name,
|
||||
action: HOTKEY_DESKTOP_LYRIC.toggle_lock.action,
|
||||
},
|
||||
'mod+alt+=': {
|
||||
type: HOTKEY_DESKTOP_LYRIC.toggle_always_top.type,
|
||||
name: HOTKEY_DESKTOP_LYRIC.toggle_always_top.name,
|
||||
action: HOTKEY_DESKTOP_LYRIC.toggle_always_top.action,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default {
|
||||
local,
|
||||
global,
|
||||
}
|
||||
115
src/common/defaultSetting.js
Normal file
115
src/common/defaultSetting.js
Normal file
@@ -0,0 +1,115 @@
|
||||
const path = require('path')
|
||||
const os = require('os')
|
||||
|
||||
const defaultSetting = {
|
||||
version: '1.0.45',
|
||||
player: {
|
||||
togglePlayMethod: 'listLoop',
|
||||
highQuality: false,
|
||||
isShowTaskProgess: true,
|
||||
volume: 1,
|
||||
isMute: false,
|
||||
mediaDeviceId: 'default',
|
||||
isMediaDeviceRemovedStopPlay: false,
|
||||
isShowLyricTranslation: false,
|
||||
isPlayLxlrc: true,
|
||||
isSavePlayTime: false,
|
||||
},
|
||||
desktopLyric: {
|
||||
enable: false,
|
||||
isLock: false,
|
||||
isAlwaysOnTop: false,
|
||||
width: 380,
|
||||
height: 420,
|
||||
x: null,
|
||||
y: null,
|
||||
theme: 0,
|
||||
isLockScreen: true,
|
||||
style: {
|
||||
font: '',
|
||||
fontSize: 120,
|
||||
opacity: 95,
|
||||
isZoomActiveLrc: true,
|
||||
},
|
||||
},
|
||||
list: {
|
||||
isShowAlbumName: true,
|
||||
isShowSource: true,
|
||||
isSaveScrollLocation: true,
|
||||
addMusicLocationType: 'top',
|
||||
},
|
||||
download: {
|
||||
enable: false,
|
||||
savePath: path.join(os.homedir(), 'Desktop'),
|
||||
fileName: '歌名 - 歌手',
|
||||
maxDownloadNum: 3,
|
||||
isDownloadLrc: false,
|
||||
lrcFormat: 'utf8',
|
||||
isEmbedPic: true,
|
||||
isEmbedLyric: false,
|
||||
isUseOtherSource: false,
|
||||
},
|
||||
leaderboard: {
|
||||
source: 'kw',
|
||||
tabId: 'kw__16',
|
||||
},
|
||||
songList: {
|
||||
source: 'kg',
|
||||
sortId: '5',
|
||||
tagInfo: {
|
||||
name: '默认',
|
||||
id: null,
|
||||
},
|
||||
},
|
||||
odc: {
|
||||
isAutoClearSearchInput: false,
|
||||
isAutoClearSearchList: false,
|
||||
},
|
||||
search: {
|
||||
searchSource: 'all',
|
||||
tempSearchSource: 'kw',
|
||||
isShowHotSearch: false,
|
||||
isShowHistorySearch: false,
|
||||
isFocusSearchBox: false,
|
||||
},
|
||||
network: {
|
||||
proxy: {
|
||||
enable: false,
|
||||
host: '',
|
||||
port: '',
|
||||
username: '',
|
||||
password: '',
|
||||
},
|
||||
},
|
||||
tray: {
|
||||
isShow: false,
|
||||
isToTray: false,
|
||||
themeId: 0,
|
||||
},
|
||||
sync: {
|
||||
enable: false,
|
||||
port: '23332',
|
||||
},
|
||||
windowSizeId: 2,
|
||||
themeId: 0,
|
||||
langId: null,
|
||||
sourceId: 'kw',
|
||||
apiSource: 'temp',
|
||||
sourceNameType: 'alias',
|
||||
isShowAnimation: true,
|
||||
randomAnimate: true,
|
||||
ignoreVersion: null,
|
||||
isAgreePact: false,
|
||||
controlBtnPosition: process.platform === 'darwin' ? 'left' : 'right',
|
||||
}
|
||||
|
||||
const overwriteSetting = {
|
||||
|
||||
}
|
||||
|
||||
// 使用新年皮肤
|
||||
if (new Date().getMonth() < 2) defaultSetting.themeId = 9
|
||||
|
||||
|
||||
exports.defaultSetting = defaultSetting
|
||||
exports.overwriteSetting = overwriteSetting
|
||||
@@ -1,156 +0,0 @@
|
||||
import { join } from 'path'
|
||||
import { homedir } from 'os'
|
||||
|
||||
const isMac = process.platform == 'darwin'
|
||||
const isWin = process.platform == 'win32'
|
||||
|
||||
const defaultSetting: LX.AppSetting = {
|
||||
version: '2.1.0',
|
||||
|
||||
'common.windowSizeId': 3,
|
||||
'common.fontSize': 16,
|
||||
'common.startInFullscreen': false,
|
||||
'common.langId': null,
|
||||
'common.apiSource': 'temp',
|
||||
'common.sourceNameType': 'alias',
|
||||
'common.font': '',
|
||||
'common.isShowAnimation': true,
|
||||
'common.randomAnimate': true,
|
||||
'common.isAgreePact': false,
|
||||
'common.controlBtnPosition': isMac ? 'left' : 'right',
|
||||
'common.playBarProgressStyle': 'mini',
|
||||
'common.tryAutoUpdate': true,
|
||||
'common.showChangeLog': true,
|
||||
|
||||
'player.startupAutoPlay': false,
|
||||
'player.togglePlayMethod': 'listLoop',
|
||||
'player.highQuality': false,
|
||||
'player.isShowTaskProgess': true,
|
||||
'player.volume': 1,
|
||||
'player.isMute': false,
|
||||
'player.playbackRate': 1,
|
||||
'player.mediaDeviceId': 'default',
|
||||
'player.isMediaDeviceRemovedStopPlay': false,
|
||||
'player.isShowLyricTranslation': false,
|
||||
'player.isShowLyricRoma': false,
|
||||
'player.isS2t': false,
|
||||
'player.isPlayLxlrc': isWin,
|
||||
'player.isSavePlayTime': false,
|
||||
'player.audioVisualization': false,
|
||||
'player.waitPlayEndStop': true,
|
||||
'player.waitPlayEndStopTime': '',
|
||||
'player.autoSkipOnError': true,
|
||||
'player.soundEffect.convolution.fileName': '',
|
||||
'player.soundEffect.convolution.mainGain': 10,
|
||||
'player.soundEffect.convolution.sendGain': 0,
|
||||
'player.soundEffect.biquadFilter.hz31': 0,
|
||||
'player.soundEffect.biquadFilter.hz62': 0,
|
||||
'player.soundEffect.biquadFilter.hz125': 0,
|
||||
'player.soundEffect.biquadFilter.hz250': 0,
|
||||
'player.soundEffect.biquadFilter.hz500': 0,
|
||||
'player.soundEffect.biquadFilter.hz1000': 0,
|
||||
'player.soundEffect.biquadFilter.hz2000': 0,
|
||||
'player.soundEffect.biquadFilter.hz4000': 0,
|
||||
'player.soundEffect.biquadFilter.hz8000': 0,
|
||||
'player.soundEffect.biquadFilter.hz16000': 0,
|
||||
'player.soundEffect.panner.enable': false,
|
||||
'player.soundEffect.panner.soundR': 5,
|
||||
'player.soundEffect.panner.speed': 25,
|
||||
|
||||
'playDetail.isZoomActiveLrc': false,
|
||||
'playDetail.isShowLyricProgressSetting': false,
|
||||
'playDetail.style.fontSize': 100,
|
||||
'playDetail.style.align': 'center',
|
||||
|
||||
'desktopLyric.enable': false,
|
||||
'desktopLyric.isLock': false,
|
||||
'desktopLyric.isAlwaysOnTop': false,
|
||||
'desktopLyric.isAlwaysOnTopLoop': false,
|
||||
'desktopLyric.isShowTaskbar': false,
|
||||
'desktopLyric.audioVisualization': false,
|
||||
'desktopLyric.fullscreenHide': true,
|
||||
'desktopLyric.width': 450,
|
||||
'desktopLyric.height': 300,
|
||||
'desktopLyric.x': null,
|
||||
'desktopLyric.y': null,
|
||||
'desktopLyric.isLockScreen': true,
|
||||
'desktopLyric.isDelayScroll': true,
|
||||
'desktopLyric.scrollAlign': 'center',
|
||||
'desktopLyric.isHoverHide': false,
|
||||
'desktopLyric.direction': 'horizontal',
|
||||
'desktopLyric.style.align': 'center',
|
||||
'desktopLyric.style.font': '',
|
||||
'desktopLyric.style.fontSize': 20,
|
||||
'desktopLyric.style.lineGap': 15,
|
||||
'desktopLyric.style.lyricUnplayColor': 'rgba(255, 255, 255, 1)',
|
||||
'desktopLyric.style.lyricPlayedColor': 'rgba(7, 197, 86, 1)',
|
||||
'desktopLyric.style.lyricShadowColor': 'rgba(0, 0, 0, 0.18)',
|
||||
// 'desktopLyric.style.fontWeight': false,
|
||||
'desktopLyric.style.opacity': 95,
|
||||
'desktopLyric.style.ellipsis': false,
|
||||
'desktopLyric.style.isZoomActiveLrc': false,
|
||||
'desktopLyric.style.isFontWeightFont': true,
|
||||
'desktopLyric.style.isFontWeightLine': true,
|
||||
'desktopLyric.style.isFontWeightExtended': true,
|
||||
|
||||
'list.isClickPlayList': false,
|
||||
'list.isShowSource': true,
|
||||
'list.isSaveScrollLocation': true,
|
||||
'list.addMusicLocationType': 'top',
|
||||
'list.actionButtonsVisible': false,
|
||||
|
||||
'download.enable': false,
|
||||
'download.savePath': join(homedir(), 'Desktop'),
|
||||
'download.fileName': '歌名 - 歌手',
|
||||
'download.maxDownloadNum': 3,
|
||||
'download.skipExistFile': true,
|
||||
'download.isDownloadLrc': false,
|
||||
'download.isDownloadTLrc': false,
|
||||
'download.isDownloadRLrc': false,
|
||||
'download.lrcFormat': 'utf8',
|
||||
'download.isEmbedPic': true,
|
||||
'download.isEmbedLyric': false,
|
||||
'download.isEmbedLyricT': false,
|
||||
'download.isEmbedLyricR': false,
|
||||
'download.isUseOtherSource': false,
|
||||
|
||||
'search.isShowHotSearch': false,
|
||||
'search.isShowHistorySearch': false,
|
||||
'search.isFocusSearchBox': false,
|
||||
|
||||
'network.proxy.enable': false,
|
||||
'network.proxy.host': '',
|
||||
'network.proxy.port': '',
|
||||
'network.proxy.username': '',
|
||||
'network.proxy.password': '',
|
||||
|
||||
'tray.enable': false,
|
||||
// 'tray.isToTray': false,
|
||||
'tray.themeId': 0,
|
||||
|
||||
'sync.mode': 'server',
|
||||
'sync.enable': false,
|
||||
'sync.server.port': '23332',
|
||||
'sync.server.maxSsnapshotNum': 5,
|
||||
'sync.client.host': '',
|
||||
|
||||
'theme.id': 'blue_plus',
|
||||
// 'theme.id': 'green',
|
||||
'theme.lightId': 'green',
|
||||
'theme.darkId': 'black',
|
||||
|
||||
'odc.isAutoClearSearchInput': false,
|
||||
'odc.isAutoClearSearchList': false,
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 使用新年皮肤
|
||||
if (new Date().getMonth() < 2) {
|
||||
defaultSetting['theme.id'] = 'happy_new_year'
|
||||
defaultSetting['desktopLyric.style.lyricPlayedColor'] = 'rgba(255, 57, 71, 1)'
|
||||
}
|
||||
|
||||
|
||||
export default defaultSetting
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
import { log } from './utils'
|
||||
const { log } = require('./utils')
|
||||
|
||||
const ignoreErrorMessage = [
|
||||
'Possible side-effect in debug-evaluate',
|
||||
'Unexpected end of input',
|
||||
]
|
||||
|
||||
process.on('uncaughtException', err => {
|
||||
if (ignoreErrorMessage.includes(err.message)) return
|
||||
process.on('uncaughtException', function(err) {
|
||||
console.error('An uncaught error occurred!')
|
||||
console.error(err)
|
||||
log.error(err)
|
||||
@@ -1,101 +1,83 @@
|
||||
import { APP_EVENT_NAMES } from './constants'
|
||||
|
||||
|
||||
const keyName = {
|
||||
common: APP_EVENT_NAMES.winMainName,
|
||||
player: APP_EVENT_NAMES.winMainName,
|
||||
desktop_lyric: APP_EVENT_NAMES.winLyricName,
|
||||
}
|
||||
|
||||
const names = require('@main/events/_name')
|
||||
const hotKey = {
|
||||
common: {
|
||||
min: {
|
||||
name: 'min',
|
||||
action: 'min',
|
||||
type: '',
|
||||
},
|
||||
min_toggle: {
|
||||
name: 'toggle_min',
|
||||
action: 'toggle_min',
|
||||
type: '',
|
||||
},
|
||||
hide_toggle: {
|
||||
name: 'toggle_hide',
|
||||
action: 'toggle_hide',
|
||||
type: '',
|
||||
},
|
||||
close: {
|
||||
name: 'toggle_close',
|
||||
action: 'toggle_close',
|
||||
type: '',
|
||||
},
|
||||
focusSearchInput: {
|
||||
name: 'focus_search_input',
|
||||
action: 'focus_search_input',
|
||||
type: '',
|
||||
},
|
||||
},
|
||||
player: {
|
||||
toggle_play: {
|
||||
name: 'toggle_play',
|
||||
action: 'toggle_play',
|
||||
type: '',
|
||||
},
|
||||
next: {
|
||||
name: 'next',
|
||||
action: 'next',
|
||||
type: '',
|
||||
},
|
||||
prev: {
|
||||
name: 'prev',
|
||||
action: 'prev',
|
||||
type: '',
|
||||
},
|
||||
volume_up: {
|
||||
name: 'volume_up',
|
||||
action: 'volume_up',
|
||||
type: '',
|
||||
},
|
||||
volume_down: {
|
||||
name: 'volume_down',
|
||||
action: 'volume_down',
|
||||
type: '',
|
||||
},
|
||||
volume_mute: {
|
||||
name: 'volume_mute',
|
||||
action: 'volume_mute',
|
||||
type: '',
|
||||
},
|
||||
},
|
||||
desktop_lyric: {
|
||||
toggle_visible: {
|
||||
name: 'toggle_visible',
|
||||
action: 'toggle_visible',
|
||||
type: '',
|
||||
},
|
||||
toggle_lock: {
|
||||
name: 'toggle_lock',
|
||||
action: 'toggle_lock',
|
||||
type: '',
|
||||
},
|
||||
toggle_always_top: {
|
||||
name: 'toggle_always_top',
|
||||
action: 'toggle_always_top',
|
||||
type: '',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for (const type of Object.keys(hotKey) as Array<keyof typeof hotKey>) {
|
||||
let keys = hotKey[type]
|
||||
for (const key of Object.keys(keys) as Array<keyof typeof keys>) {
|
||||
const keyInfo: LX.HotKey = keys[key]
|
||||
keyInfo.action = `${type}_${keyInfo.action}`
|
||||
keyInfo.name = `${type}_${keyInfo.name}`
|
||||
keyInfo.type = keyName[type] as keyof typeof hotKey
|
||||
const keyName = {
|
||||
player: names.mainWindow.name,
|
||||
desktop_lyric: names.winLyric.name,
|
||||
}
|
||||
|
||||
for (const type of Object.keys(hotKey)) {
|
||||
let item = hotKey[type]
|
||||
for (const key of Object.keys(item)) {
|
||||
item[key].action = `${type}_${item[key].action}`
|
||||
item[key].name = `${type}_${item[key].name}`
|
||||
item[key].type = keyName[type]
|
||||
}
|
||||
}
|
||||
|
||||
export const HOTKEY_COMMON = hotKey.common
|
||||
export const HOTKEY_PLAYER = hotKey.player
|
||||
export const HOTKEY_DESKTOP_LYRIC = hotKey.desktop_lyric
|
||||
exports.common = hotKey.common
|
||||
exports.player = hotKey.player
|
||||
exports.desktop_lyric = hotKey.desktop_lyric
|
||||
52
src/common/ipc.js
Normal file
52
src/common/ipc.js
Normal file
@@ -0,0 +1,52 @@
|
||||
const { ipcMain, ipcRenderer } = require('electron')
|
||||
const names = require('./ipcNames')
|
||||
|
||||
|
||||
exports.mainOn = (name, callback) => {
|
||||
ipcMain.on(name, callback)
|
||||
}
|
||||
exports.mainOnce = (name, callback) => {
|
||||
ipcMain.once(name, callback)
|
||||
}
|
||||
exports.mainOff = (name, callback) => {
|
||||
ipcMain.removeListener(name, callback)
|
||||
}
|
||||
exports.mainOffAll = name => {
|
||||
ipcMain.removeAllListeners(name)
|
||||
}
|
||||
|
||||
exports.mainHandle = (name, callback) => {
|
||||
ipcMain.handle(name, callback)
|
||||
}
|
||||
exports.mainHandleOnce = (name, callback) => {
|
||||
ipcMain.handleOnce(name, callback)
|
||||
}
|
||||
exports.mainHandleRemove = name => {
|
||||
ipcMain.removeListener(name)
|
||||
}
|
||||
|
||||
exports.mainSend = (window, name, params) => {
|
||||
window.webContents.send(name, params)
|
||||
}
|
||||
|
||||
exports.rendererSend = (name, params) => {
|
||||
ipcRenderer.send(name, params)
|
||||
}
|
||||
exports.rendererSendSync = (name, params) => ipcRenderer.sendSync(name, params)
|
||||
|
||||
exports.rendererInvoke = (name, params) => ipcRenderer.invoke(name, params)
|
||||
|
||||
exports.rendererOn = (name, callback) => {
|
||||
ipcRenderer.on(name, callback)
|
||||
}
|
||||
exports.rendererOnce = (name, callback) => {
|
||||
ipcRenderer.once(name, callback)
|
||||
}
|
||||
exports.rendererOff = (name, callback) => {
|
||||
ipcRenderer.removeListener(name, callback)
|
||||
}
|
||||
exports.rendererOffAll = name => {
|
||||
ipcRenderer.removeAllListeners(name)
|
||||
}
|
||||
|
||||
exports.NAMES = names
|
||||
106
src/common/ipcNames.js
Normal file
106
src/common/ipcNames.js
Normal file
@@ -0,0 +1,106 @@
|
||||
const names = {
|
||||
mainWindow: {
|
||||
focus: 'focus',
|
||||
close: 'close',
|
||||
min: 'min',
|
||||
max: 'max',
|
||||
set_app_name: 'set_app_name',
|
||||
clear_cache: 'clear_cache',
|
||||
get_cache_size: 'get_cache_size',
|
||||
get_env_params: 'get_env_params',
|
||||
|
||||
set_music_meta: 'set_music_meta',
|
||||
progress: 'progress',
|
||||
change_tray: 'change_tray',
|
||||
quit_update: 'quit_update',
|
||||
update_available: 'update_available',
|
||||
update_error: 'update_error',
|
||||
update_progress: 'update_progress',
|
||||
update_downloaded: 'update_downloaded',
|
||||
update_not_available: 'update_not_available',
|
||||
set_ignore_mouse_events: 'set_ignore_mouse_events',
|
||||
set_app_setting: 'set_app_setting',
|
||||
set_window_size: 'set_window_size',
|
||||
show_save_dialog: 'show_save_dialog',
|
||||
get_system_fonts: 'get_system_fonts',
|
||||
|
||||
handle_request: 'handle_request',
|
||||
cancel_request: 'cancel_request',
|
||||
|
||||
handle_xm_verify_open: 'handle_xm_verify_open',
|
||||
handle_xm_verify_close: 'handle_xm_verify_close',
|
||||
select_dir: 'select_dir',
|
||||
|
||||
restart_window: 'restart_window',
|
||||
|
||||
lang_s2t: 'lang_s2t',
|
||||
|
||||
handle_kw_decode_lyric: 'handle_kw_decode_lyric',
|
||||
get_lyric_info: 'get_lyric_info',
|
||||
set_lyric_info: 'set_lyric_info',
|
||||
set_config: 'set_config',
|
||||
set_hot_key_config: 'set_hot_key_config',
|
||||
key_down: 'key_down',
|
||||
quit: 'quit',
|
||||
min_toggle: 'min_toggle',
|
||||
hide_toggle: 'hide_toggle',
|
||||
get_data_path: 'get_data_path',
|
||||
show_dialog: 'show_dialog',
|
||||
|
||||
get_setting: 'get_setting',
|
||||
get_playlist: 'get_playlist',
|
||||
save_playlist: 'save_playlist',
|
||||
get_data: 'get_data',
|
||||
save_data: 'save_data',
|
||||
get_hot_key: 'get_hot_key',
|
||||
|
||||
import_user_api: 'import_user_api',
|
||||
remove_user_api: 'remove_user_api',
|
||||
set_user_api: 'set_user_api',
|
||||
get_user_api_list: 'get_user_api_list',
|
||||
request_user_api: 'request_user_api',
|
||||
request_user_api_cancel: 'request_user_api_cancel',
|
||||
get_user_api_status: 'get_user_api_status',
|
||||
user_api_status: 'user_api_status',
|
||||
|
||||
get_lyric: 'get_lyric',
|
||||
save_lyric: 'save_lyric',
|
||||
clear_lyric: 'clear_lyric',
|
||||
get_music_url: 'get_music_url',
|
||||
save_music_url: 'save_music_url',
|
||||
clear_music_url: 'clear_music_url',
|
||||
|
||||
sync_enable: 'sync_enable',
|
||||
sync_status: 'sync_status',
|
||||
sync_get_status: 'sync_get_status',
|
||||
sync_generate_code: 'sync_generate_code',
|
||||
sync_action_list: 'sync_action_list',
|
||||
sync_list: 'sync_list',
|
||||
|
||||
},
|
||||
winLyric: {
|
||||
close: 'close',
|
||||
set_lyric_info: 'set_lyric_info',
|
||||
get_lyric_info: 'get_lyric_info',
|
||||
set_lyric_config: 'set_lyric_config',
|
||||
get_lyric_config: 'get_lyric_config',
|
||||
set_win_bounds: 'set_win_bounds',
|
||||
key_down: 'key_down',
|
||||
},
|
||||
hotKey: {
|
||||
enable: 'enable',
|
||||
status: 'status',
|
||||
set_config: 'set_config',
|
||||
},
|
||||
}
|
||||
|
||||
for (const item of Object.keys(names)) {
|
||||
let name = names[item]
|
||||
for (const key of Object.keys(name)) {
|
||||
name[key] = `${item}_${name[key]}`
|
||||
}
|
||||
}
|
||||
|
||||
exports.mainWindow = names.mainWindow
|
||||
exports.winLyric = names.winLyric
|
||||
exports.hotKey = names.hotKey
|
||||
@@ -1,183 +0,0 @@
|
||||
const modules = {
|
||||
common: {
|
||||
get_env_params: 'get_env_params',
|
||||
deeplink: 'deeplink',
|
||||
clear_env_params_deeplink: 'clear_env_params_deeplink',
|
||||
system_theme_change: 'system_theme_change',
|
||||
theme_change: 'theme_change',
|
||||
get_system_fonts: 'get_system_fonts',
|
||||
get_app_setting: 'get_app_setting',
|
||||
set_app_setting: 'set_app_setting',
|
||||
},
|
||||
player: {
|
||||
invoke_play_music: 'play_music',
|
||||
invoke_play_next: 'play_next',
|
||||
invoke_play_prev: 'play_prev',
|
||||
invoke_toggle_play: 'toggle_play',
|
||||
player_play: 'player_play',
|
||||
player_pause: 'player_pause',
|
||||
player_stop: 'player_stop',
|
||||
player_error: 'player_error',
|
||||
|
||||
list_data_overwire: 'list_data_overwire',
|
||||
list_get: 'list_get',
|
||||
list_add: 'list_add',
|
||||
list_remove: 'list_remove',
|
||||
list_update: 'list_update',
|
||||
list_update_position: 'list_update_position',
|
||||
list_music_get: 'list_music_get',
|
||||
list_music_add: 'list_music_add',
|
||||
list_music_move: 'list_music_move',
|
||||
list_music_remove: 'list_music_remove',
|
||||
list_music_update: 'list_music_update',
|
||||
list_music_update_position: 'list_music_update_position',
|
||||
list_music_overwrite: 'list_music_overwrite',
|
||||
list_music_clear: 'list_music_clear',
|
||||
list_music_check_exist: 'list_music_check_exist',
|
||||
list_music_get_list_ids: 'list_music_get_list_ids',
|
||||
},
|
||||
winMain: {
|
||||
focus: 'focus',
|
||||
close: 'close',
|
||||
min: 'min',
|
||||
max: 'max',
|
||||
fullscreen: 'fullscreen',
|
||||
set_app_name: 'set_app_name',
|
||||
clear_cache: 'clear_cache',
|
||||
get_cache_size: 'get_cache_size',
|
||||
inited: 'inited',
|
||||
show_save_dialog: 'show_save_dialog',
|
||||
show_select_dialog: 'show_select_dialog',
|
||||
show_dialog: 'show_dialog',
|
||||
open_dev_tools: 'open_dev_tools',
|
||||
|
||||
progress: 'progress',
|
||||
change_tray: 'change_tray',
|
||||
quit_update: 'quit_update',
|
||||
update_check: 'update_check',
|
||||
update_download_update: 'update_download_update',
|
||||
update_available: 'update_available',
|
||||
update_error: 'update_error',
|
||||
update_progress: 'update_progress',
|
||||
update_downloaded: 'update_downloaded',
|
||||
update_not_available: 'update_not_available',
|
||||
set_ignore_mouse_events: 'set_ignore_mouse_events',
|
||||
set_window_size: 'set_window_size',
|
||||
|
||||
handle_request: 'handle_request',
|
||||
cancel_request: 'cancel_request',
|
||||
|
||||
|
||||
restart_window: 'restart_window',
|
||||
|
||||
// lang_s2t: 'lang_s2t',
|
||||
|
||||
handle_kw_decode_lyric: 'handle_kw_decode_lyric',
|
||||
handle_tx_decode_lyric: 'handle_tx_decode_lyric',
|
||||
get_lyric_info: 'get_lyric_info',
|
||||
set_lyric_info: 'set_lyric_info',
|
||||
set_config: 'set_config',
|
||||
set_hot_key_config: 'set_hot_key_config',
|
||||
on_config_change: 'on_config_change',
|
||||
key_down: 'key_down',
|
||||
quit: 'quit',
|
||||
min_toggle: 'min_toggle',
|
||||
hide_toggle: 'hide_toggle',
|
||||
|
||||
get_other_source: 'get_other_source',
|
||||
save_other_source: 'save_other_source',
|
||||
clear_other_source: 'clear_other_source',
|
||||
get_other_source_count: 'get_other_source_count',
|
||||
get_data: 'get_data',
|
||||
save_data: 'save_data',
|
||||
get_sound_effect_eq_preset: 'get_sound_effect_eq_preset',
|
||||
save_sound_effect_eq_preset: 'save_sound_effect_eq_preset',
|
||||
get_sound_effect_convolution_preset: 'get_sound_effect_convolution_preset',
|
||||
save_sound_effect_convolution_preset: 'save_sound_effect_convolution_preset',
|
||||
get_hot_key: 'get_hot_key',
|
||||
|
||||
import_user_api: 'import_user_api',
|
||||
remove_user_api: 'remove_user_api',
|
||||
set_user_api: 'set_user_api',
|
||||
get_user_api_list: 'get_user_api_list',
|
||||
request_user_api: 'request_user_api',
|
||||
request_user_api_cancel: 'request_user_api_cancel',
|
||||
get_user_api_status: 'get_user_api_status',
|
||||
user_api_status: 'user_api_status',
|
||||
user_api_show_update_alert: 'user_api_show_update_alert',
|
||||
user_api_set_allow_update_alert: 'user_api_set_allow_update_alert',
|
||||
|
||||
get_palyer_lyric: 'get_lyric',
|
||||
// save_lyric: 'save_lyric',
|
||||
// clear_lyric: 'clear_lyric',
|
||||
get_lyric_raw: 'get_lyric_raw',
|
||||
save_lyric_raw: 'save_lyric_raw',
|
||||
clear_lyric_raw: 'clear_lyric_raw',
|
||||
get_lyric_raw_count: 'get_lyric_raw_count',
|
||||
get_lyric_edited: 'get_lyric_edited',
|
||||
save_lyric_edited: 'save_lyric_edited',
|
||||
remove_lyric_edited: 'remove_lyric_edited',
|
||||
clear_lyric_edited: 'clear_lyric_edited',
|
||||
get_lyric_edited_count: 'get_lyric_edited_count',
|
||||
get_music_url: 'get_music_url',
|
||||
save_music_url: 'save_music_url',
|
||||
clear_music_url: 'clear_music_url',
|
||||
get_music_url_count: 'get_music_url_count',
|
||||
|
||||
sync_action: 'sync_action',
|
||||
|
||||
process_new_desktop_lyric_client: 'process_new_desktop_lyric_client',
|
||||
|
||||
player_action_set_buttons: 'player_action_set_buttons',
|
||||
// player_action_set_thumbnail_clip: 'player_action_set_thumbnail_clip',
|
||||
player_action_on_button_click: 'player_action_on_button_click',
|
||||
|
||||
get_themes: 'get_themes',
|
||||
save_theme: 'save_theme',
|
||||
remove_theme: 'remove_theme',
|
||||
|
||||
download_list_get: 'download_list_get',
|
||||
download_list_add: 'download_list_add',
|
||||
download_list_update: 'download_list_update',
|
||||
download_list_remove: 'download_list_remove',
|
||||
download_list_clear: 'download_list_clear',
|
||||
},
|
||||
winLyric: {
|
||||
close: 'close',
|
||||
set_config: 'set_config',
|
||||
get_config: 'get_config',
|
||||
on_config_change: 'on_config_change',
|
||||
main_window_inited: 'main_window_inited',
|
||||
set_win_bounds: 'set_win_bounds',
|
||||
key_down: 'key_down',
|
||||
request_main_window_channel: 'request_main_window_channel',
|
||||
provide_main_window_channel: 'provide_main_window_channel',
|
||||
},
|
||||
hotKey: {
|
||||
enable: 'enable',
|
||||
status: 'status',
|
||||
set_config: 'set_config',
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
for (const moduleName of Object.keys(modules) as Array<keyof typeof modules>) {
|
||||
let eventNames = modules[moduleName]
|
||||
for (const eventName of Object.keys(eventNames) as Array<keyof typeof eventNames>) {
|
||||
eventNames[eventName] = `${moduleName}_${eventName as string}` as never
|
||||
}
|
||||
}
|
||||
|
||||
// for (const moduleName of Object.keys(modules) as Array<keyof typeof modules>) {
|
||||
// let eventNames = modules[moduleName]
|
||||
// for (const eventName of Object.keys(eventNames)) {
|
||||
// eventNames[eventName] = `${moduleName}_${eventName}`
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
export const CMMON_EVENT_NAME = modules.common
|
||||
export const PLAYER_EVENT_NAME = modules.player
|
||||
export const WIN_MAIN_RENDERER_EVENT_NAME = modules.winMain
|
||||
export const WIN_LYRIC_RENDERER_EVENT_NAME = modules.winLyric
|
||||
export const HOTKEY_RENDERER_EVENT_NAME = modules.hotKey
|
||||
@@ -1,54 +0,0 @@
|
||||
import { ipcMain } from 'electron'
|
||||
|
||||
export function mainOn(name: string, listener: LX.IpcMainEventListener): void
|
||||
export function mainOn<T>(name: string, listener: LX.IpcMainEventListenerParams<T>): void
|
||||
export function mainOn<T>(name: string, listener: LX.IpcMainEventListenerParams<T>): void {
|
||||
ipcMain.on(name, (event, params) => {
|
||||
listener({ event, params })
|
||||
})
|
||||
}
|
||||
|
||||
export function mainOnce(name: string, listener: LX.IpcMainEventListener): void
|
||||
export function mainOnce<T>(name: string, listener: LX.IpcMainEventListenerParams<T>): void
|
||||
export function mainOnce<T>(name: string, listener: LX.IpcMainEventListenerParams<T>): void {
|
||||
ipcMain.once(name, (event, params) => {
|
||||
listener({ event, params })
|
||||
})
|
||||
}
|
||||
|
||||
export const mainOff = (name: string, listener: (...args: any[]) => void) => {
|
||||
ipcMain.removeListener(name, listener)
|
||||
}
|
||||
|
||||
export const mainOffAll = (name: string) => {
|
||||
ipcMain.removeAllListeners(name)
|
||||
}
|
||||
|
||||
export function mainHandle(name: string, listener: LX.IpcMainInvokeEventListener): void
|
||||
export function mainHandle<T>(name: string, listener: LX.IpcMainInvokeEventListenerParams<T>): void
|
||||
export function mainHandle<V>(name: string, listener: LX.IpcMainInvokeEventListenerValue<V>): void
|
||||
export function mainHandle<T, V>(name: string, listener: LX.IpcMainInvokeEventListenerParamsValue<T, V>): void
|
||||
export function mainHandle<T, V>(name: string, listener: LX.IpcMainInvokeEventListenerParamsValue<T, V>): void {
|
||||
ipcMain.handle(name, async(event, params) => {
|
||||
return await listener({ event, params })
|
||||
})
|
||||
}
|
||||
|
||||
export function mainHandleOnce(name: string, listener: LX.IpcMainInvokeEventListener): void
|
||||
export function mainHandleOnce<T>(name: string, listener: LX.IpcMainInvokeEventListenerParams<T>): void
|
||||
export function mainHandleOnce<V>(name: string, listener: LX.IpcMainInvokeEventListenerValue<V>): void
|
||||
export function mainHandleOnce<T, V>(name: string, listener: LX.IpcMainInvokeEventListenerParamsValue<T, V>): void
|
||||
export function mainHandleOnce<T, V>(name: string, listener: LX.IpcMainInvokeEventListenerParamsValue<T, V>): void {
|
||||
ipcMain.handleOnce(name, async(event, params) => {
|
||||
return await listener({ event, params })
|
||||
})
|
||||
}
|
||||
export const mainHandleRemove = (name: string) => {
|
||||
ipcMain.removeHandler(name)
|
||||
}
|
||||
|
||||
export function mainSend(window: Electron.BrowserWindow, name: string): void
|
||||
export function mainSend<T>(window: Electron.BrowserWindow, name: string, params: T): void
|
||||
export function mainSend<T>(window: Electron.BrowserWindow, name: string, params?: T): void {
|
||||
window.webContents.send(name, params)
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
import { ipcRenderer } from 'electron'
|
||||
|
||||
export function rendererSend(name: string): void
|
||||
export function rendererSend<T>(name: string, params: T): void
|
||||
export function rendererSend<T>(name: string, params?: T): void {
|
||||
ipcRenderer.send(name, params)
|
||||
}
|
||||
|
||||
export function rendererSendSync(name: string): void
|
||||
export function rendererSendSync<T>(name: string, params: T): void
|
||||
export function rendererSendSync<T>(name: string, params?: T): void {
|
||||
ipcRenderer.sendSync(name, params)
|
||||
}
|
||||
|
||||
export async function rendererInvoke(name: string): Promise<void>
|
||||
export async function rendererInvoke<V>(name: string): Promise<V>
|
||||
export async function rendererInvoke<T>(name: string, params: T): Promise<void>
|
||||
export async function rendererInvoke<T, V>(name: string, params: T): Promise<V>
|
||||
export async function rendererInvoke <T, V>(name: string, params?: T): Promise<V> {
|
||||
return await ipcRenderer.invoke(name, params)
|
||||
}
|
||||
|
||||
export function rendererOn(name: string, listener: LX.IpcRendererEventListener): void
|
||||
export function rendererOn<T>(name: string, listener: LX.IpcRendererEventListenerParams<T>): void
|
||||
export function rendererOn<T>(name: string, listener: LX.IpcRendererEventListenerParams<T>): void {
|
||||
ipcRenderer.on(name, (event, params) => {
|
||||
listener({ event, params })
|
||||
})
|
||||
}
|
||||
|
||||
export function rendererOnce(name: string, listener: LX.IpcRendererEventListener): void
|
||||
export function rendererOnce<T>(name: string, listener: LX.IpcRendererEventListenerParams<T>): void
|
||||
export function rendererOnce<T>(name: string, listener: LX.IpcRendererEventListenerParams<T>): void {
|
||||
ipcRenderer.once(name, (event, params) => {
|
||||
listener({ event, params })
|
||||
})
|
||||
}
|
||||
|
||||
export const rendererOff = (name: string, listener: (...args: any[]) => any) => {
|
||||
ipcRenderer.removeListener(name, listener)
|
||||
}
|
||||
|
||||
export const rendererOffAll = (name: string) => {
|
||||
ipcRenderer.removeAllListeners(name)
|
||||
}
|
||||
42
src/common/store.js
Normal file
42
src/common/store.js
Normal file
@@ -0,0 +1,42 @@
|
||||
const Store = require('electron-store')
|
||||
const { dialog, app, shell } = require('electron')
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
const log = require('electron-log')
|
||||
|
||||
const stores = {}
|
||||
|
||||
/**
|
||||
* 获取 Store 对象
|
||||
* @param {*} name store 名
|
||||
* @param {*} isIgnoredError 是否忽略错误
|
||||
* @param {*} isShowErrorAlert 是否显示错误弹窗
|
||||
* @returns Store
|
||||
*/
|
||||
module.exports = (name, isIgnoredError = true, isShowErrorAlert = true) => {
|
||||
if (stores[name]) return stores[name]
|
||||
let store
|
||||
try {
|
||||
store = stores[name] = new Store({ name, clearInvalidConfig: false })
|
||||
} catch (error) {
|
||||
log.error(error)
|
||||
|
||||
if (!isIgnoredError) throw error
|
||||
|
||||
|
||||
const backPath = path.join(app.getPath('userData'), name + '.json.bak')
|
||||
fs.copyFileSync(path.join(app.getPath('userData'), name + '.json'), backPath)
|
||||
if (isShowErrorAlert) {
|
||||
dialog.showMessageBoxSync({
|
||||
type: 'error',
|
||||
message: name + ' data load error',
|
||||
detail: `We have helped you back up the old ${name} file to: ${backPath}\nYou can try to repair and restore it manually\n\nError detail: ${error.message}`,
|
||||
})
|
||||
shell.showItemInFolder(backPath)
|
||||
}
|
||||
|
||||
|
||||
store = new Store({ name, clearInvalidConfig: true })
|
||||
}
|
||||
return store
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
/* eslint-disable */
|
||||
// https://github.com/PimpTrizkit/PJs/wiki/12.-Shade,-Blend-and-Convert-a-Web-Color-(pSBC.js)#micro-functions-version-4
|
||||
|
||||
/**
|
||||
* Blend color (Lighten or Darken)
|
||||
* @param {number} p 混合百分比 范围 0.0 - 1.0
|
||||
* @param {string} c0 rgb(a) color1
|
||||
* @param {string} c1 rgb(a) color2
|
||||
* @returns color
|
||||
*/
|
||||
exports.RGB_Linear_Blend=(p,c0,c1)=>{
|
||||
var i=parseInt,r=Math.round,P=1-p,[a,b,c,d]=c0.split(","),[e,f,g,h]=c1.split(","),x=d||h,j=x?","+(!d?h:!h?d:r((parseFloat(d)*P+parseFloat(h)*p)*1000)/1000+")"):")";
|
||||
return"rgb"+(x?"a(":"(")+r(i(a[3]=="a"?a.slice(5):a.slice(4))*P+i(e[3]=="a"?e.slice(5):e.slice(4))*p)+","+r(i(b)*P+i(f)*p)+","+r(i(c)*P+i(g)*p)+j;
|
||||
}
|
||||
|
||||
/**
|
||||
* Blend color (Lighten or Darken)
|
||||
* @param {number} p 混合百分比 范围 0.0 - 1.0
|
||||
* @param {string} c0 rgb(a) color1
|
||||
* @param {string} c1 rgb(a) color2
|
||||
* @returns color
|
||||
*/
|
||||
exports.RGB_Log_Blend=(p,c0,c1)=>{
|
||||
var i=parseInt,r=Math.round,P=1-p,[a,b,c,d]=c0.split(","),[e,f,g,h]=c1.split(","),x=d||h,j=x?","+(!d?h:!h?d:r((parseFloat(d)*P+parseFloat(h)*p)*1000)/1000+")"):")";
|
||||
return"rgb"+(x?"a(":"(")+r((P*i(a[3]=="a"?a.slice(5):a.slice(4))**2+p*i(e[3]=="a"?e.slice(5):e.slice(4))**2)**0.5)+","+r((P*i(b)**2+p*i(f)**2)**0.5)+","+r((P*i(c)**2+p*i(g)**2)**0.5)+j;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shade color (Lighten or Darken)
|
||||
* @param {number} p Shade 百分比范围为 -1.0 - 1.0 负为黑色,正为白色
|
||||
* @param {string} c0 rgb(a) color
|
||||
* @returns color
|
||||
*/
|
||||
exports.RGB_Linear_Shade=(p,c0)=>{
|
||||
var i=parseInt,r=Math.round,[a,b,c,d]=c0.split(","),n=p<0,t=n?0:255*p,P=n?1+p:1-p;
|
||||
return"rgb"+(d?"a(":"(")+r(i(a[3]=="a"?a.slice(5):a.slice(4))*P+t)+","+r(i(b)*P+t)+","+r(i(c)*P+t)+(d?","+d:")");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shade color (Lighten or Darken)
|
||||
* @param {number} p Shade 百分比范围为 -1.0 - 1.0 负为黑色,正为白色
|
||||
* @param {string} c0 rgb(a) color
|
||||
* @returns color
|
||||
*/
|
||||
exports.RGB_Log_Shade=(p,c0)=>{
|
||||
var i=parseInt,r=Math.round,[a,b,c,d]=c0.split(","),n=p<0,t=n?0:p*255**2,P=n?1+p:1-p;
|
||||
return"rgb"+(d?"a(":"(")+r((P*i(a[3]=="a"?a.slice(5):a.slice(4))**2+t)**0.5)+","+r((P*i(b)**2+t)**0.5)+","+r((P*i(c)**2+t)**0.5)+(d?","+d:")");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改透明度
|
||||
* @param {number} p 透明度 -1.0 - 1.0
|
||||
* @param {string} color
|
||||
* @returns color
|
||||
*/
|
||||
exports.RGB_Alpha_Shade = (p, color) => {
|
||||
var i = parseInt
|
||||
var n = p < 0
|
||||
var [r, g, b, a] = color.split(",")
|
||||
r = r[3] == 'a' ? r.slice(5) : r.slice(4)
|
||||
if (a) {
|
||||
a = parseFloat(a)
|
||||
a = a - (n ? (1 - a) * p : a * p)
|
||||
a = n ? Math.max(0, a) : Math.min(1, a)
|
||||
} else {
|
||||
a = 1 - p
|
||||
a = Math.min(1, a)
|
||||
}
|
||||
return `rgba(${i(r)}, ${i(g)}, ${i(b)}, ${a.toFixed(2)})`
|
||||
}
|
||||
@@ -1,369 +0,0 @@
|
||||
//! 更新默认主题配置后,需要执行 npm run build:theme 重新构建index.json
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const { createThemeColors } = require('./utils')
|
||||
|
||||
const defaultThemes = [
|
||||
{
|
||||
id: 'green',
|
||||
name: '绿意盎然',
|
||||
isDark: false,
|
||||
config: {
|
||||
primary: 'rgb(77, 175, 124)',
|
||||
font: 'rgb(33, 33, 33)',
|
||||
'--color-app-background': 'var(--color-primary-light-600-alpha-700)',
|
||||
'--color-main-background': 'rgba(255, 255, 255, 1)',
|
||||
'--color-nav-font': 'var(--color-primary)',
|
||||
'--background-image': 'none',
|
||||
'--background-image-position': 'center',
|
||||
'--background-image-size': 'cover',
|
||||
|
||||
'--color-btn-hide': '#3bc2b2',
|
||||
'--color-btn-min': '#85c43b',
|
||||
'--color-btn-close': '#fab4a0',
|
||||
|
||||
'--color-badge-primary': 'var(--color-primary)',
|
||||
'--color-badge-secondary': '#4baed5',
|
||||
'--color-badge-tertiary': '#e7aa36',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'blue',
|
||||
name: '蓝田生玉',
|
||||
isDark: false,
|
||||
config: {
|
||||
primary: 'rgb(52, 152, 219)',
|
||||
font: 'rgb(33, 33, 33)',
|
||||
'--color-app-background': 'var(--color-primary-light-600-alpha-700)',
|
||||
'--color-main-background': 'rgba(255, 255, 255, 1)',
|
||||
'--color-nav-font': 'var(--color-primary)',
|
||||
'--background-image': 'none',
|
||||
'--background-image-position': 'center',
|
||||
'--background-image-size': 'cover',
|
||||
|
||||
'--color-btn-hide': '#3bc2b2',
|
||||
'--color-btn-min': '#85c43b',
|
||||
'--color-btn-close': '#fab4a0',
|
||||
|
||||
'--color-badge-primary': 'var(--color-primary)',
|
||||
'--color-badge-secondary': '#5cbf9b',
|
||||
'--color-badge-tertiary': '#5cbf9b',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'blue_plus',
|
||||
name: '蛋雅深蓝',
|
||||
isDark: false,
|
||||
config: {
|
||||
primary: 'rgb(77, 131, 175)',
|
||||
font: 'rgb(33, 33, 33)',
|
||||
'--color-app-background': 'var(--color-primary-light-600-alpha-600)',
|
||||
'--color-main-background': 'rgba(255, 255, 255, 1)',
|
||||
'--color-nav-font': 'var(--color-primary)',
|
||||
'--background-image': 'none',
|
||||
'--background-image-position': 'center',
|
||||
'--background-image-size': 'cover',
|
||||
|
||||
'--color-btn-hide': '#3bc2b2',
|
||||
'--color-btn-min': '#85c43b',
|
||||
'--color-btn-close': '#fab4a0',
|
||||
|
||||
'--color-badge-primary': 'var(--color-primary)',
|
||||
'--color-badge-secondary': 'rgba(66.6, 150.7, 171, 1)',
|
||||
'--color-badge-tertiary': 'rgba(54, 196, 231, 1)',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'orange',
|
||||
name: '橙黄橘绿',
|
||||
isDark: false,
|
||||
config: {
|
||||
primary: 'rgb(245, 171, 53)',
|
||||
font: 'rgb(33, 33, 33)',
|
||||
'--color-app-background': 'var(--color-primary-light-600-alpha-700)',
|
||||
'--color-main-background': 'rgba(255, 255, 255, 1)',
|
||||
'--color-nav-font': 'var(--color-primary)',
|
||||
'--background-image': 'none',
|
||||
'--background-image-position': 'center',
|
||||
'--background-image-size': 'cover',
|
||||
|
||||
'--color-btn-hide': '#3bc2b2',
|
||||
'--color-btn-min': '#85c43b',
|
||||
'--color-btn-close': '#fab4a0',
|
||||
|
||||
'--color-badge-primary': 'var(--color-primary)',
|
||||
'--color-badge-secondary': '#9ed458',
|
||||
'--color-badge-tertiary': '#9ed458',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'red',
|
||||
name: '热情似火',
|
||||
isDark: false,
|
||||
config: {
|
||||
primary: 'rgb(214, 69, 65)',
|
||||
font: 'rgb(33, 33, 33)',
|
||||
'--color-app-background': 'var(--color-primary-light-600-alpha-700)',
|
||||
'--color-main-background': 'rgba(255, 255, 255, 1)',
|
||||
'--color-nav-font': 'var(--color-primary)',
|
||||
'--background-image': 'none',
|
||||
'--background-image-position': 'center',
|
||||
'--background-image-size': 'cover',
|
||||
|
||||
'--color-btn-hide': '#3bc2b2',
|
||||
'--color-btn-min': '#85c43b',
|
||||
'--color-btn-close': '#fab4a0',
|
||||
|
||||
'--color-badge-primary': 'var(--color-primary)',
|
||||
'--color-badge-secondary': '#dfbb6b',
|
||||
'--color-badge-tertiary': '#dfbb6b',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'pink',
|
||||
name: '粉装玉琢',
|
||||
isDark: false,
|
||||
config: {
|
||||
primary: 'rgb(241, 130, 141)',
|
||||
font: 'rgb(33, 33, 33)',
|
||||
'--color-app-background': 'var(--color-primary-light-600-alpha-700)',
|
||||
'--color-main-background': 'rgba(255, 255, 255, 1)',
|
||||
'--color-nav-font': 'var(--color-primary)',
|
||||
'--background-image': 'none',
|
||||
'--background-image-position': 'center',
|
||||
'--background-image-size': 'cover',
|
||||
|
||||
'--color-btn-hide': '#3bc2b2',
|
||||
'--color-btn-min': '#85c43b',
|
||||
'--color-btn-close': '#fab4a0',
|
||||
|
||||
'--color-badge-primary': 'var(--color-primary)',
|
||||
'--color-badge-secondary': '#f5b684',
|
||||
'--color-badge-tertiary': '#f5b684',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'purple',
|
||||
name: '重斤球紫',
|
||||
isDark: false,
|
||||
config: {
|
||||
primary: 'rgb(155, 89, 182)',
|
||||
font: 'rgb(33, 33, 33)',
|
||||
'--color-app-background': 'var(--color-primary-light-600-alpha-700)',
|
||||
'--color-main-background': 'rgba(255, 255, 255, 1)',
|
||||
'--color-nav-font': 'var(--color-primary)',
|
||||
'--background-image': 'none',
|
||||
'--background-image-position': 'center',
|
||||
'--background-image-size': 'cover',
|
||||
|
||||
'--color-btn-hide': '#3bc2b2',
|
||||
'--color-btn-min': '#85c43b',
|
||||
'--color-btn-close': '#fab4a0',
|
||||
|
||||
'--color-badge-primary': 'var(--color-primary)',
|
||||
'--color-badge-secondary': '#e5a39f',
|
||||
'--color-badge-tertiary': '#e5a39f',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'grey',
|
||||
name: '灰常美丽',
|
||||
isDark: false,
|
||||
config: {
|
||||
primary: 'rgb(108, 122, 137)',
|
||||
font: 'rgb(33, 33, 33)',
|
||||
'--color-app-background': 'var(--color-primary-light-600-alpha-700)',
|
||||
'--color-main-background': 'rgba(255, 255, 255, 1)',
|
||||
'--color-nav-font': 'var(--color-primary)',
|
||||
'--background-image': 'none',
|
||||
'--background-image-position': 'center',
|
||||
'--background-image-size': 'cover',
|
||||
|
||||
'--color-btn-hide': '#3bc2b2',
|
||||
'--color-btn-min': '#85c43b',
|
||||
'--color-btn-close': '#fab4a0',
|
||||
|
||||
'--color-badge-primary': 'var(--color-primary)',
|
||||
'--color-badge-secondary': '#b19b9f',
|
||||
'--color-badge-tertiary': '#b19b9f',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'ming',
|
||||
name: '青出于黑',
|
||||
isDark: false,
|
||||
config: {
|
||||
primary: 'rgb(51, 110, 123)',
|
||||
font: 'rgb(33, 33, 33)',
|
||||
'--color-app-background': 'var(--color-primary-light-600-alpha-700)',
|
||||
'--color-main-background': 'rgba(255, 255, 255, 1)',
|
||||
'--color-nav-font': 'var(--color-primary)',
|
||||
'--background-image': 'none',
|
||||
'--background-image-position': 'center',
|
||||
'--background-image-size': 'cover',
|
||||
|
||||
'--color-btn-hide': '#3bc2b2',
|
||||
'--color-btn-min': '#85c43b',
|
||||
'--color-btn-close': '#fab4a0',
|
||||
|
||||
'--color-badge-primary': 'var(--color-primary)',
|
||||
'--color-badge-secondary': '#6376a2',
|
||||
'--color-badge-tertiary': '#6376a2',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'blue2',
|
||||
name: '清热板蓝',
|
||||
isDark: false,
|
||||
config: {
|
||||
primary: 'rgb(79, 98, 208)',
|
||||
font: 'rgb(33, 33, 33)',
|
||||
'--color-app-background': 'var(--color-primary-light-600-alpha-700)',
|
||||
'--color-main-background': 'rgba(255, 255, 255, 1)',
|
||||
'--color-nav-font': 'var(--color-primary)',
|
||||
'--background-image': 'none',
|
||||
'--background-image-position': 'center',
|
||||
'--background-image-size': 'cover',
|
||||
|
||||
'--color-btn-hide': '#3bc2b2',
|
||||
'--color-btn-min': '#85c43b',
|
||||
'--color-btn-close': '#fab4a0',
|
||||
|
||||
'--color-badge-primary': 'var(--color-primary)',
|
||||
'--color-badge-secondary': '#b080db',
|
||||
'--color-badge-tertiary': '#b080db',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'black',
|
||||
name: '黑灯瞎火',
|
||||
isDark: true,
|
||||
config: {
|
||||
primary: 'rgb(150, 150, 150)',
|
||||
font: 'rgb(229, 229, 229)',
|
||||
'--color-app-background': 'rgba(0, 0, 0, 0)',
|
||||
'--color-main-background': 'rgba(19, 19, 19, 0.9)',
|
||||
'--color-nav-font': 'var(--color-primary)',
|
||||
'--background-image': 'url(./theme_images/landingMoon.png)',
|
||||
'--background-image-position': 'center',
|
||||
'--background-image-size': 'cover',
|
||||
|
||||
'--color-btn-hide': '#3bc2b2',
|
||||
'--color-btn-min': '#85c43b',
|
||||
'--color-btn-close': '#fab4a0',
|
||||
|
||||
'--color-badge-primary': 'var(--color-primary-dark-200)',
|
||||
'--color-badge-secondary': 'var(--color-primary)',
|
||||
'--color-badge-tertiary': 'var(--color-primary-dark-300)',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'mid_autumn',
|
||||
name: '月里嫦娥',
|
||||
isDark: false,
|
||||
config: {
|
||||
primary: 'rgb(74, 55, 82)',
|
||||
font: 'rgb(33, 33, 33)',
|
||||
'--color-app-background': 'rgba(255, 255, 255, 0)',
|
||||
'--color-main-background': 'rgba(255, 255, 255, 0.9)',
|
||||
'--color-nav-font': 'var(--color-primary-light-600)',
|
||||
'--background-image': 'url(./theme_images/jqbg.jpg)',
|
||||
'--background-image-position': 'center',
|
||||
'--background-image-size': 'cover',
|
||||
|
||||
|
||||
'--color-btn-hide': '#3bc2b2',
|
||||
'--color-btn-min': '#85c43b',
|
||||
'--color-btn-close': '#fab4a0',
|
||||
|
||||
'--color-badge-primary': 'var(--color-primary)',
|
||||
'--color-badge-secondary': '#af9479',
|
||||
'--color-badge-tertiary': '#af9479',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'naruto',
|
||||
name: '木叶之村',
|
||||
isDark: false,
|
||||
config: {
|
||||
primary: 'rgb(87, 144, 167)',
|
||||
font: 'rgb(33, 33, 33)',
|
||||
'--color-app-background': 'rgba(255, 255, 255, 0.15)',
|
||||
'--color-main-background': 'rgba(255, 255, 255, 0.8)',
|
||||
'--color-nav-font': 'var(--color-primary)',
|
||||
'--background-image': 'url(./theme_images/myzcbg.jpg)',
|
||||
'--background-image-position': 'center',
|
||||
'--background-image-size': 'cover',
|
||||
|
||||
'--color-btn-hide': '#3bc2b2',
|
||||
'--color-btn-min': '#85c43b',
|
||||
'--color-btn-close': '#fab4a0',
|
||||
|
||||
'--color-badge-primary': 'var(--color-primary)',
|
||||
'--color-badge-secondary': 'var(--color-primary-light-100)',
|
||||
'--color-badge-tertiary': 'var(--color-primary-light-100)',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'china_ink',
|
||||
name: '近墨者黑',
|
||||
isDark: false,
|
||||
config: {
|
||||
primary: 'rgba(47, 47, 47, 1)',
|
||||
font: 'rgb(33, 33, 33)',
|
||||
'--color-app-background': 'rgba(255, 255, 255, 0)',
|
||||
'--color-main-background': 'rgba(255, 255, 255, 0.8)',
|
||||
'--color-nav-font': 'var(--color-primary)',
|
||||
'--background-image': 'url(./theme_images/china_ink.jpg)',
|
||||
'--background-image-position': 'center',
|
||||
'--background-image-size': 'cover',
|
||||
|
||||
|
||||
'--color-btn-hide': 'rgba(183, 212, 208, 1)',
|
||||
'--color-btn-min': 'rgba(200, 214, 183, 1)',
|
||||
'--color-btn-close': 'rgba(218, 195, 188, 1)',
|
||||
|
||||
'--color-badge-primary': 'rgba(137, 70, 70, 1)',
|
||||
'--color-badge-secondary': 'rgba(67, 139, 65, 1)',
|
||||
'--color-badge-tertiary': 'rgba(132, 135, 65, 1)',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'happy_new_year',
|
||||
name: '新年快乐',
|
||||
isDark: false,
|
||||
config: {
|
||||
primary: 'rgb(192, 57, 43)',
|
||||
font: 'rgb(33, 33, 33)',
|
||||
'--color-app-background': 'rgba(255, 255, 255, 0.15)',
|
||||
'--color-main-background': 'rgba(255, 255, 255, 0.8)',
|
||||
'--color-nav-font': 'var(--color-primary)',
|
||||
'--background-image': 'url(./theme_images/xnkl.png)',
|
||||
'--background-image-position': 'center',
|
||||
'--background-image-size': 'cover',
|
||||
|
||||
'--color-btn-hide': '#3bc2b2',
|
||||
'--color-btn-min': '#85c43b',
|
||||
'--color-btn-close': '#fab4a0',
|
||||
|
||||
'--color-badge-primary': '#7fb575',
|
||||
'--color-badge-secondary': '#dfbb6b',
|
||||
'--color-badge-tertiary': 'var(--color-primary-light-100)',
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
const themes = defaultThemes.map(({ config: { primary, font, ...extInfo }, ...themeInfo }) => {
|
||||
return {
|
||||
...themeInfo,
|
||||
isCustom: false,
|
||||
config: {
|
||||
themeColors: createThemeColors(primary, font, themeInfo.isDark),
|
||||
extInfo,
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
fs.writeFileSync(path.join(__dirname, 'index.json'), JSON.stringify(themes, null, 2))
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 997 KiB |
File diff suppressed because it is too large
Load Diff
@@ -1,75 +0,0 @@
|
||||
const { RGB_Linear_Shade, RGB_Alpha_Shade } = require('./colorUtils')
|
||||
|
||||
exports.createThemeColors = (rgbaColor, fontRgbaColor, isDark) => {
|
||||
const colors = {
|
||||
'--color-primary': rgbaColor,
|
||||
}
|
||||
|
||||
let preColor = rgbaColor
|
||||
for (let i = 1; i < 11; i += 1) {
|
||||
preColor = RGB_Linear_Shade(isDark ? 0.2 : -0.1, preColor)
|
||||
colors[`--color-primary-dark-${i * 100}`] = preColor
|
||||
for (let j = 1; j < 10; j += 1) {
|
||||
colors[`--color-primary-dark-${i * 100}-alpha-${j * 100}`] = RGB_Alpha_Shade(0.1 * j, preColor)
|
||||
colors[`--color-primary-alpha-${j * 100}`] = RGB_Alpha_Shade(0.1 * j, rgbaColor)
|
||||
}
|
||||
}
|
||||
preColor = rgbaColor
|
||||
for (let i = 1; i < 10; i += 1) {
|
||||
preColor = RGB_Linear_Shade(isDark ? -0.1 : 0.2, preColor)
|
||||
colors[`--color-primary-light-${i * 100}`] = preColor
|
||||
for (let j = 1; j < 10; j += 1) {
|
||||
colors[`--color-primary-light-${i * 100}-alpha-${j * 100}`] = RGB_Alpha_Shade(0.1 * j, preColor)
|
||||
}
|
||||
}
|
||||
preColor = RGB_Linear_Shade(isDark ? -0.2 : 1, preColor)
|
||||
colors[`--color-primary-light-${1000}`] = preColor
|
||||
for (let j = 1; j < 10; j += 1) {
|
||||
colors[`--color-primary-light-${1000}-alpha-${j * 100}`] = RGB_Alpha_Shade(0.1 * j, preColor)
|
||||
}
|
||||
|
||||
colors['--color-theme'] = isDark ? colors['--color-primary-light-900'] : rgbaColor
|
||||
|
||||
return { ...colors, ...createFontColors(fontRgbaColor, isDark) }
|
||||
}
|
||||
|
||||
const createFontColors = (rgbaColor, isDark) => {
|
||||
// rgb(238, 238, 238)
|
||||
// let prec = 'rgb(255, 255, 255)'
|
||||
rgbaColor ??= isDark ? 'rgb(229, 229, 229)' : 'rgb(33, 33, 33)'
|
||||
if (isDark) return createFontDarkColors(rgbaColor)
|
||||
|
||||
let colors = {
|
||||
'--color-1000': rgbaColor,
|
||||
}
|
||||
let step = isDark ? -0.05 : 0.05
|
||||
for (let i = 1; i < 21; i += 1) {
|
||||
colors[`--color-${String(1000 - 50 * i).padStart(3, '0')}`] = RGB_Linear_Shade(step * i, rgbaColor)
|
||||
}
|
||||
// console.log(colors)
|
||||
return colors
|
||||
}
|
||||
|
||||
const createFontDarkColors = (rgbaColor) => {
|
||||
// rgb(238, 238, 238)
|
||||
// let prec = 'rgb(255, 255, 255)'
|
||||
|
||||
let colors = {
|
||||
'--color-1000': rgbaColor,
|
||||
}
|
||||
const step = -0.05
|
||||
let preColor = rgbaColor
|
||||
for (let i = 1; i < 21; i += 1) {
|
||||
preColor = RGB_Linear_Shade(step, preColor)
|
||||
colors[`--color-${String(1000 - 50 * i).padStart(3, '0')}`] = preColor
|
||||
}
|
||||
|
||||
// console.log(colors)
|
||||
return colors
|
||||
}
|
||||
|
||||
// console.log(createFontColors('rgb(33, 33, 33)', false))
|
||||
// console.log(createFontColors('rgb(255, 255, 255)', true))
|
||||
|
||||
// console.log(createFontDarkColors('rgb(255, 255, 255)'))
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "esnext",
|
||||
"moduleResolution": "nodenext",
|
||||
"typeRoots": [ /* Specify multiple folders that act like './node_modules/@types'. */
|
||||
"./types"
|
||||
],
|
||||
},
|
||||
// "include": [
|
||||
// "**/*.ts",
|
||||
// "**/*.js",
|
||||
// "**/*.vue",
|
||||
// "**/*.json",
|
||||
// ],
|
||||
}
|
||||
624
src/common/types/app_setting.d.ts
vendored
624
src/common/types/app_setting.d.ts
vendored
@@ -1,624 +0,0 @@
|
||||
import type { I18n } from '@/lang/i18n'
|
||||
|
||||
declare global {
|
||||
|
||||
declare namespace LX {
|
||||
type AddMusicLocationType = 'top' | 'bottom'
|
||||
|
||||
interface AppSetting {
|
||||
version: string
|
||||
|
||||
/**
|
||||
* 窗口大小id
|
||||
*/
|
||||
'common.windowSizeId': number
|
||||
|
||||
/**
|
||||
* 窗口大小id
|
||||
*/
|
||||
'common.fontSize': number
|
||||
|
||||
/**
|
||||
* 是否以全屏启动
|
||||
*/
|
||||
'common.startInFullscreen': boolean
|
||||
|
||||
/**
|
||||
* 语言id
|
||||
*/
|
||||
'common.langId': I18n['locale'] | null
|
||||
|
||||
/**
|
||||
* api id
|
||||
*/
|
||||
'common.apiSource': string
|
||||
|
||||
/**
|
||||
* 音源名称类型,原名、别名
|
||||
*/
|
||||
'common.sourceNameType': 'alias' | 'real'
|
||||
|
||||
/**
|
||||
* 显示的字体
|
||||
*/
|
||||
'common.font': string
|
||||
|
||||
/**
|
||||
* 是否启用动画
|
||||
*/
|
||||
'common.isShowAnimation': boolean
|
||||
|
||||
/**
|
||||
* 是否启用随机弹窗动画
|
||||
*/
|
||||
'common.randomAnimate': boolean
|
||||
|
||||
/**
|
||||
* 是否同意软件协议
|
||||
*/
|
||||
'common.isAgreePact': boolean
|
||||
|
||||
/**
|
||||
* 控制按钮位置,左边、右边
|
||||
*/
|
||||
'common.controlBtnPosition': 'left' | 'right'
|
||||
|
||||
/**
|
||||
* 播放栏进度条样式
|
||||
*/
|
||||
'common.playBarProgressStyle': 'mini' | 'full' | 'middle'
|
||||
|
||||
/**
|
||||
* 尝试自动更新
|
||||
*/
|
||||
'common.tryAutoUpdate': boolean
|
||||
|
||||
/**
|
||||
* 更新版本后是否显示变更日志
|
||||
*/
|
||||
'common.showChangeLog': boolean
|
||||
|
||||
/**
|
||||
* 启动时自动播放歌曲
|
||||
*/
|
||||
'player.startupAutoPlay': boolean
|
||||
|
||||
/**
|
||||
* 切歌模式
|
||||
*/
|
||||
'player.togglePlayMethod': 'listLoop' | 'random' | 'list' | 'singleLoop' | 'none'
|
||||
|
||||
/**
|
||||
* 是否优先播放320k音质
|
||||
*/
|
||||
'player.highQuality': boolean
|
||||
|
||||
/**
|
||||
* 是否显示任务栏进度条
|
||||
*/
|
||||
'player.isShowTaskProgess': boolean
|
||||
|
||||
/**
|
||||
* 音量大小
|
||||
*/
|
||||
'player.volume': number
|
||||
|
||||
/**
|
||||
* 是否静音
|
||||
*/
|
||||
'player.isMute': boolean
|
||||
|
||||
/**
|
||||
* 播放速率
|
||||
*/
|
||||
'player.playbackRate': number
|
||||
|
||||
/**
|
||||
* 音频输出设备id
|
||||
*/
|
||||
'player.mediaDeviceId': string
|
||||
|
||||
/**
|
||||
* 是否在音频输出设备更改时暂停播放
|
||||
*/
|
||||
'player.isMediaDeviceRemovedStopPlay': boolean
|
||||
|
||||
/**
|
||||
* 是否显示歌词翻译
|
||||
*/
|
||||
'player.isShowLyricTranslation': boolean
|
||||
|
||||
/**
|
||||
* 是否显示歌词罗马音
|
||||
*/
|
||||
'player.isShowLyricRoma': boolean
|
||||
|
||||
/**
|
||||
* 是否将歌词从简体转换为繁体
|
||||
*/
|
||||
'player.isS2t': boolean
|
||||
|
||||
/**
|
||||
* 是否播放卡拉OK歌词
|
||||
*/
|
||||
'player.isPlayLxlrc': boolean
|
||||
|
||||
/**
|
||||
* 启动软件时是否恢复上次播放进度
|
||||
*/
|
||||
'player.isSavePlayTime': boolean
|
||||
|
||||
/**
|
||||
* 是否启用音频可视化
|
||||
*/
|
||||
'player.audioVisualization': boolean
|
||||
|
||||
/**
|
||||
* 定时暂停播放-是否等待歌曲播放完毕再暂停
|
||||
*/
|
||||
'player.waitPlayEndStop': boolean
|
||||
|
||||
/**
|
||||
* 定时暂停播放-倒计时时间
|
||||
*/
|
||||
'player.waitPlayEndStopTime': string
|
||||
|
||||
/**
|
||||
* 环境音效文件名
|
||||
*/
|
||||
'player.soundEffect.convolution.fileName': string | null
|
||||
|
||||
/**
|
||||
* 环境音效原始输出增益
|
||||
*/
|
||||
'player.soundEffect.convolution.mainGain': number
|
||||
|
||||
/**
|
||||
* 环境音效输出增益
|
||||
*/
|
||||
'player.soundEffect.convolution.sendGain': number
|
||||
|
||||
/**
|
||||
* 均衡器 31hz 值
|
||||
*/
|
||||
'player.soundEffect.biquadFilter.hz31': number
|
||||
|
||||
/**
|
||||
* 均衡器 62hz 值
|
||||
*/
|
||||
'player.soundEffect.biquadFilter.hz62': number
|
||||
|
||||
/**
|
||||
* 均衡器 125hz 值
|
||||
*/
|
||||
'player.soundEffect.biquadFilter.hz125': number
|
||||
|
||||
/**
|
||||
* 均衡器 250hz 值
|
||||
*/
|
||||
'player.soundEffect.biquadFilter.hz250': number
|
||||
|
||||
/**
|
||||
* 均衡器 500hz 值
|
||||
*/
|
||||
'player.soundEffect.biquadFilter.hz500': number
|
||||
|
||||
/**
|
||||
* 均衡器 1000hz 值
|
||||
*/
|
||||
'player.soundEffect.biquadFilter.hz1000': number
|
||||
|
||||
/**
|
||||
* 均衡器 2000hz 值
|
||||
*/
|
||||
'player.soundEffect.biquadFilter.hz2000': number
|
||||
|
||||
/**
|
||||
* 均衡器 4000hz 值
|
||||
*/
|
||||
'player.soundEffect.biquadFilter.hz4000': number
|
||||
|
||||
/**
|
||||
* 均衡器 8000hz 值
|
||||
*/
|
||||
'player.soundEffect.biquadFilter.hz8000': number
|
||||
|
||||
/**
|
||||
* 均衡器 16000hz 值
|
||||
*/
|
||||
'player.soundEffect.biquadFilter.hz16000': number
|
||||
|
||||
/**
|
||||
* 3D立体环绕是否启用
|
||||
*/
|
||||
'player.soundEffect.panner.enable': boolean
|
||||
|
||||
/**
|
||||
* 3D立体环绕声音距离
|
||||
*/
|
||||
'player.soundEffect.panner.soundR': number
|
||||
|
||||
/**
|
||||
* 3D立体环绕速度
|
||||
*/
|
||||
'player.soundEffect.panner.speed': number
|
||||
|
||||
/**
|
||||
* 是否启用音频加载失败时自动切歌
|
||||
*/
|
||||
'player.autoSkipOnError': boolean
|
||||
|
||||
/**
|
||||
* 播放详情页-是否缩放当前播放的歌词行
|
||||
*/
|
||||
'playDetail.isZoomActiveLrc': boolean
|
||||
|
||||
/**
|
||||
* 播放详情页-是否允许通过歌词调整播放进度
|
||||
*/
|
||||
'playDetail.isShowLyricProgressSetting': boolean
|
||||
|
||||
/**
|
||||
* 播放详情页-歌词字体大小
|
||||
*/
|
||||
'playDetail.style.fontSize': number
|
||||
|
||||
/**
|
||||
* 播放详情页-歌词对齐方式
|
||||
*/
|
||||
'playDetail.style.align': 'center' | 'left' | 'right'
|
||||
|
||||
|
||||
/**
|
||||
* 是否启用桌面歌词
|
||||
*/
|
||||
'desktopLyric.enable': boolean
|
||||
|
||||
/**
|
||||
* 是否锁定桌面歌词
|
||||
*/
|
||||
'desktopLyric.isLock': boolean
|
||||
|
||||
/**
|
||||
* 是在置顶桌面
|
||||
*/
|
||||
'desktopLyric.isAlwaysOnTop': boolean
|
||||
|
||||
/**
|
||||
* 是否自动刷新歌词置顶
|
||||
*/
|
||||
'desktopLyric.isAlwaysOnTopLoop': boolean
|
||||
|
||||
/**
|
||||
* 是否将歌词进程显示在任务栏
|
||||
*/
|
||||
'desktopLyric.isShowTaskbar': boolean
|
||||
|
||||
/**
|
||||
* 是否启用音频可视化
|
||||
*/
|
||||
'desktopLyric.audioVisualization': boolean
|
||||
|
||||
/**
|
||||
* 是否在全屏时隐藏歌词
|
||||
*/
|
||||
'desktopLyric.fullscreenHide': boolean
|
||||
|
||||
/**
|
||||
* 桌面歌词窗口宽度
|
||||
*/
|
||||
'desktopLyric.width': number
|
||||
|
||||
/**
|
||||
* 桌面歌词窗口高度
|
||||
*/
|
||||
'desktopLyric.height': number
|
||||
|
||||
/**
|
||||
* 桌面歌词窗口x坐标
|
||||
*/
|
||||
'desktopLyric.x': number | null
|
||||
|
||||
/**
|
||||
* 桌面歌词窗口y坐标
|
||||
*/
|
||||
'desktopLyric.y': number | null
|
||||
|
||||
/**
|
||||
* 是否允许桌面歌词窗口拖出主屏幕之外
|
||||
*/
|
||||
'desktopLyric.isLockScreen': boolean
|
||||
|
||||
/**
|
||||
* 是否延迟桌面歌词滚动
|
||||
*/
|
||||
'desktopLyric.isDelayScroll': boolean
|
||||
|
||||
/**
|
||||
* 歌词滚动位置
|
||||
*/
|
||||
'desktopLyric.scrollAlign': 'top' | 'center'
|
||||
|
||||
/**
|
||||
* 是否在鼠标划过桌面歌词窗口时降低歌词透明度
|
||||
*/
|
||||
'desktopLyric.isHoverHide': boolean
|
||||
|
||||
/**
|
||||
* 歌词方向
|
||||
*/
|
||||
'desktopLyric.direction': 'horizontal' | 'vertical'
|
||||
|
||||
/**
|
||||
* 歌词对齐方式
|
||||
*/
|
||||
'desktopLyric.style.align': 'center' | 'left' | 'right'
|
||||
|
||||
/**
|
||||
* 桌面歌词字体
|
||||
*/
|
||||
'desktopLyric.style.font': string
|
||||
|
||||
/**
|
||||
* 桌面歌词字体大小
|
||||
*/
|
||||
'desktopLyric.style.fontSize': number
|
||||
|
||||
/**
|
||||
* 歌词间距大小
|
||||
*/
|
||||
'desktopLyric.style.lineGap': number
|
||||
|
||||
/**
|
||||
* 桌面歌词未播放字体颜色
|
||||
*/
|
||||
'desktopLyric.style.lyricUnplayColor': string
|
||||
|
||||
/**
|
||||
* 桌面歌词已播放字体颜色
|
||||
*/
|
||||
'desktopLyric.style.lyricPlayedColor': string
|
||||
|
||||
/**
|
||||
* 桌面歌词字体阴影颜色
|
||||
*/
|
||||
'desktopLyric.style.lyricShadowColor': string
|
||||
|
||||
/**
|
||||
* 桌面歌词加粗字体
|
||||
*/
|
||||
// 'desktopLyric.style.fontWeight': boolean
|
||||
|
||||
/**
|
||||
* 桌面歌词字体透明度
|
||||
*/
|
||||
'desktopLyric.style.opacity': number
|
||||
|
||||
/**
|
||||
* 桌面歌词是否允许换行
|
||||
*/
|
||||
'desktopLyric.style.ellipsis': boolean
|
||||
|
||||
/**
|
||||
* 是否缩放当前正在播放的桌面歌词
|
||||
*/
|
||||
'desktopLyric.style.isZoomActiveLrc': boolean
|
||||
|
||||
/**
|
||||
* 是否加粗逐字歌词字体
|
||||
*/
|
||||
'desktopLyric.style.isFontWeightFont': boolean
|
||||
|
||||
/**
|
||||
* 是否加粗逐行歌词字体
|
||||
*/
|
||||
'desktopLyric.style.isFontWeightLine': boolean
|
||||
|
||||
/**
|
||||
* 是否加粗翻译、罗马音字体
|
||||
*/
|
||||
'desktopLyric.style.isFontWeightExtended': boolean
|
||||
|
||||
/**
|
||||
* 是否启用双击列表里的歌曲时自动切换到当前列表播放(仅对歌单、排行榜有效)
|
||||
*/
|
||||
'list.isClickPlayList': boolean
|
||||
|
||||
/**
|
||||
* 是否显示歌曲来源(仅对我的列表有效)
|
||||
*/
|
||||
'list.isShowSource': boolean
|
||||
|
||||
/**
|
||||
* 是否自动恢复列表滚动位置(仅对我的列表有效)
|
||||
*/
|
||||
'list.isSaveScrollLocation': boolean
|
||||
|
||||
/**
|
||||
* 添加歌曲到我的列表时的方式
|
||||
*/
|
||||
'list.addMusicLocationType': LX.AddMusicLocationType
|
||||
|
||||
/**
|
||||
* 是否显示列表操作按钮列
|
||||
*/
|
||||
'list.actionButtonsVisible': boolean
|
||||
|
||||
/**
|
||||
* 是否启用下载功能
|
||||
*/
|
||||
'download.enable': boolean
|
||||
|
||||
/**
|
||||
* 下载路径
|
||||
*/
|
||||
'download.savePath': string
|
||||
|
||||
/**
|
||||
* 文件命名方式
|
||||
*/
|
||||
'download.fileName': '歌名 - 歌手' | '歌手 - 歌名' | '歌名'
|
||||
|
||||
/**
|
||||
* 最大并发下载数
|
||||
*/
|
||||
'download.maxDownloadNum': number
|
||||
|
||||
/**
|
||||
* 存在同名文件时跳过下载
|
||||
*/
|
||||
'download.skipExistFile': boolean
|
||||
|
||||
/**
|
||||
* 是否下载lrc文件
|
||||
*/
|
||||
'download.isDownloadLrc': boolean
|
||||
|
||||
/**
|
||||
* 是否下载翻译歌词文件
|
||||
*/
|
||||
'download.isDownloadTLrc': boolean
|
||||
|
||||
/**
|
||||
* 是否下载罗马音歌词文件
|
||||
*/
|
||||
'download.isDownloadRLrc': boolean
|
||||
|
||||
/**
|
||||
* 保存lrc时的文本编码格式
|
||||
*/
|
||||
'download.lrcFormat': 'utf8' | 'gbk'
|
||||
|
||||
/**
|
||||
* 是否在音频文件中嵌入歌曲封面
|
||||
*/
|
||||
'download.isEmbedPic': boolean
|
||||
|
||||
/**
|
||||
* 是否在音频文件中嵌入歌词
|
||||
*/
|
||||
'download.isEmbedLyric': boolean
|
||||
|
||||
/**
|
||||
* 是否在音频文件中嵌入翻译歌词
|
||||
*/
|
||||
'download.isEmbedLyricT': boolean
|
||||
|
||||
/**
|
||||
* 是否在音频文件中嵌入罗马音歌词
|
||||
*/
|
||||
'download.isEmbedLyricR': boolean
|
||||
|
||||
/**
|
||||
* 歌曲源不可用时,是否启用换源下载
|
||||
*/
|
||||
'download.isUseOtherSource': boolean
|
||||
|
||||
/**
|
||||
* 主题id
|
||||
*/
|
||||
'theme.id': string
|
||||
|
||||
/**
|
||||
* 亮色主题id
|
||||
*/
|
||||
'theme.lightId': string
|
||||
|
||||
/**
|
||||
* 暗色主题id
|
||||
*/
|
||||
'theme.darkId': string
|
||||
|
||||
/**
|
||||
* 是否显示热门搜索
|
||||
*/
|
||||
'search.isShowHotSearch': boolean
|
||||
|
||||
/**
|
||||
* 是否显示搜索历史
|
||||
*/
|
||||
'search.isShowHistorySearch': boolean
|
||||
|
||||
/**
|
||||
* 软件启动时是否自动聚焦搜索框
|
||||
*/
|
||||
'search.isFocusSearchBox': boolean
|
||||
|
||||
/**
|
||||
* 是否启用代理
|
||||
*/
|
||||
'network.proxy.enable': boolean
|
||||
|
||||
/**
|
||||
* 代理服务器地址
|
||||
*/
|
||||
'network.proxy.host': string
|
||||
|
||||
/**
|
||||
* 代理服务器端口号
|
||||
*/
|
||||
'network.proxy.port': string
|
||||
|
||||
/**
|
||||
* 代理服务器用户名
|
||||
*/
|
||||
'network.proxy.username': string
|
||||
|
||||
/**
|
||||
* 代理服务器密码
|
||||
*/
|
||||
'network.proxy.password': string
|
||||
|
||||
/**
|
||||
* 是否启用托盘
|
||||
*/
|
||||
'tray.enable': boolean
|
||||
|
||||
/**
|
||||
* 是否关闭时是否最小化到托盘
|
||||
*/
|
||||
// 'tray.isToTray': boolean
|
||||
|
||||
/**
|
||||
* 托盘主题id
|
||||
*/
|
||||
'tray.themeId': number
|
||||
|
||||
/**
|
||||
* 同步服务模式
|
||||
*/
|
||||
'sync.mode': 'server' | 'client'
|
||||
|
||||
/**
|
||||
* 是否启用同步服务
|
||||
*/
|
||||
'sync.enable': boolean
|
||||
|
||||
/**
|
||||
* 同步服务端口号
|
||||
*/
|
||||
'sync.server.port': '23332' | string
|
||||
|
||||
/**
|
||||
* 最大备份快照数
|
||||
*/
|
||||
'sync.server.maxSsnapshotNum': number
|
||||
|
||||
/**
|
||||
* 同步服务地址
|
||||
*/
|
||||
'sync.client.host': string
|
||||
|
||||
/**
|
||||
* 是否在离开搜索界面时自动清空搜索框
|
||||
*/
|
||||
'odc.isAutoClearSearchInput': boolean
|
||||
|
||||
/**
|
||||
* 是否在离开搜索界面时自动清空搜索结果列表
|
||||
*/
|
||||
'odc.isAutoClearSearchList': boolean
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
110
src/common/types/common.d.ts
vendored
110
src/common/types/common.d.ts
vendored
@@ -1,110 +0,0 @@
|
||||
// import './app_setting'
|
||||
|
||||
declare namespace LX {
|
||||
interface CmdParams {
|
||||
/**
|
||||
* 搜索,启动软件时自动在搜索框搜索指定的内容,例如:-search="突然的自我 - 伍佰"
|
||||
*/
|
||||
search?: string
|
||||
|
||||
/**
|
||||
* 禁用硬件加速启动
|
||||
*/
|
||||
dha?: boolean
|
||||
|
||||
/**
|
||||
* 以非透明模式启动
|
||||
*/
|
||||
dt?: boolean
|
||||
|
||||
/**
|
||||
* 禁用硬件媒体密钥处理
|
||||
*/
|
||||
dhmkh?: boolean
|
||||
|
||||
/**
|
||||
* 设置代理服务器,代理应用的所有流量,例:-proxy-server="127.0.0.1:1081"(不支持设置账号密码,v1.17.0起新增)。注:应用内“设置-网络-代理设置”仅代理接口请求的流量,优先级更高
|
||||
*/
|
||||
'proxy-server'?: string
|
||||
|
||||
/**
|
||||
* 以分号分隔的主机列表绕过代理服务器,例:-proxy-bypass-list="<local>;*.google.com;*foo.com;1.2.3.4:5678"(与-proxy-server一起使用才有效,v1.17.0起新增)。注:此设置对应用内接口请求无效
|
||||
*/
|
||||
'proxy-bypass-list'?: string
|
||||
|
||||
/**
|
||||
* 启动时播放指定列表的音乐
|
||||
*/
|
||||
play?: string
|
||||
|
||||
[key: string]: boolean | number | string
|
||||
}
|
||||
|
||||
type OnlineSource = 'kw' | 'kg' | 'tx' | 'wy' | 'mg'
|
||||
type Source = OnlineSource | 'local'
|
||||
type Quality = '128k' | '320k' | 'flac' | 'flac24bit' | '192k' | 'ape' | 'wav'
|
||||
|
||||
type QualityList = Partial<Record<LX.Source, LX.Quality[]>>
|
||||
|
||||
interface EnvParams {
|
||||
deeplink?: string | null
|
||||
cmdParams: CmdParams
|
||||
workAreaSize?: Electron.Size
|
||||
}
|
||||
|
||||
interface HotKey {
|
||||
name: string
|
||||
action: string
|
||||
type: keyof typeof keyName
|
||||
}
|
||||
|
||||
interface HotKeyDownInfo {
|
||||
type: 'local' | 'global'
|
||||
key: string
|
||||
}
|
||||
|
||||
interface HotKeyConfig {
|
||||
enable: boolean
|
||||
keys: Record<string, HotKey>
|
||||
}
|
||||
interface HotKeyConfigAll {
|
||||
local: HotKeyConfig
|
||||
global: HotKeyConfig
|
||||
}
|
||||
interface RegisterKeyInfo {
|
||||
key: string
|
||||
info: HotKey
|
||||
}
|
||||
type HotKeyState = Map<string, {
|
||||
status: boolean
|
||||
info: HotKey
|
||||
}>
|
||||
interface HotKeyActionWrap<T, D> {
|
||||
action: T
|
||||
data: D
|
||||
source?: string
|
||||
}
|
||||
type HotKeyActions = HotKeyActionWrap<'config', HotKeyConfigAll>
|
||||
| HotKeyActionWrap<'enable', boolean>
|
||||
| HotKeyActionWrap<'register', RegisterKeyInfo>
|
||||
| HotKeyActionWrap<'unregister', string>
|
||||
|
||||
interface HotKeyEvent {
|
||||
type: string
|
||||
key: string
|
||||
}
|
||||
|
||||
interface TaskBarButtonFlags {
|
||||
empty: boolean
|
||||
collect: boolean
|
||||
play: boolean
|
||||
next: boolean
|
||||
prev: boolean
|
||||
}
|
||||
|
||||
type UpdateStatus = 'downloaded' | 'downloading' | 'error' | 'checking' | 'idle'
|
||||
interface VersionInfo {
|
||||
version: string
|
||||
desc: string
|
||||
}
|
||||
}
|
||||
9
src/common/types/config_files.d.ts
vendored
9
src/common/types/config_files.d.ts
vendored
@@ -1,9 +0,0 @@
|
||||
declare namespace LX {
|
||||
namespace ConfigFile {
|
||||
interface MyListInfoPart {
|
||||
type: 'playListPart_v2'
|
||||
data: LX.List.MyDefaultListInfoFull | LX.List.MyLoveListInfoFull | LX.List.UserListInfoFull
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
90
src/common/types/desktop_lyric.d.ts
vendored
90
src/common/types/desktop_lyric.d.ts
vendored
@@ -1,90 +0,0 @@
|
||||
declare namespace LX {
|
||||
namespace DesktopLyric {
|
||||
interface Config {
|
||||
'desktopLyric.enable': LX.AppSetting['desktopLyric.enable']
|
||||
'desktopLyric.isLock': LX.AppSetting['desktopLyric.isLock']
|
||||
'desktopLyric.isAlwaysOnTop': LX.AppSetting['desktopLyric.isAlwaysOnTop']
|
||||
'desktopLyric.isAlwaysOnTopLoop': LX.AppSetting['desktopLyric.isAlwaysOnTopLoop']
|
||||
'desktopLyric.isShowTaskbar': LX.AppSetting['desktopLyric.isShowTaskbar']
|
||||
'desktopLyric.audioVisualization': LX.AppSetting['desktopLyric.audioVisualization']
|
||||
'desktopLyric.width': LX.AppSetting['desktopLyric.width']
|
||||
'desktopLyric.height': LX.AppSetting['desktopLyric.height']
|
||||
'desktopLyric.x': LX.AppSetting['desktopLyric.x']
|
||||
'desktopLyric.y': LX.AppSetting['desktopLyric.y']
|
||||
'desktopLyric.isLockScreen': LX.AppSetting['desktopLyric.isLockScreen']
|
||||
'desktopLyric.isDelayScroll': LX.AppSetting['desktopLyric.isDelayScroll']
|
||||
'desktopLyric.scrollAlign': LX.AppSetting['desktopLyric.scrollAlign']
|
||||
'desktopLyric.isHoverHide': LX.AppSetting['desktopLyric.isHoverHide']
|
||||
'desktopLyric.direction': LX.AppSetting['desktopLyric.direction']
|
||||
'desktopLyric.style.align': LX.AppSetting['desktopLyric.style.align']
|
||||
'desktopLyric.style.font': LX.AppSetting['desktopLyric.style.font']
|
||||
'desktopLyric.style.fontSize': LX.AppSetting['desktopLyric.style.fontSize']
|
||||
'desktopLyric.style.lineGap': LX.AppSetting['desktopLyric.style.lineGap']
|
||||
'desktopLyric.style.lyricUnplayColor': LX.AppSetting['desktopLyric.style.lyricUnplayColor']
|
||||
'desktopLyric.style.lyricPlayedColor': LX.AppSetting['desktopLyric.style.lyricPlayedColor']
|
||||
'desktopLyric.style.lyricShadowColor': LX.AppSetting['desktopLyric.style.lyricShadowColor']
|
||||
// 'desktopLyric.style.fontWeight': LX.AppSetting['desktopLyric.style.fontWeight']
|
||||
'desktopLyric.style.opacity': LX.AppSetting['desktopLyric.style.opacity']
|
||||
'desktopLyric.style.ellipsis': LX.AppSetting['desktopLyric.style.ellipsis']
|
||||
'desktopLyric.style.isFontWeightFont': LX.AppSetting['desktopLyric.style.isFontWeightFont']
|
||||
'desktopLyric.style.isFontWeightLine': LX.AppSetting['desktopLyric.style.isFontWeightLine']
|
||||
'desktopLyric.style.isFontWeightExtended': LX.AppSetting['desktopLyric.style.isFontWeightExtended']
|
||||
'desktopLyric.style.isZoomActiveLrc': LX.AppSetting['desktopLyric.style.isZoomActiveLrc']
|
||||
'common.langId': LX.AppSetting['common.langId']
|
||||
'player.isShowLyricTranslation': LX.AppSetting['player.isShowLyricTranslation']
|
||||
'player.isShowLyricRoma': LX.AppSetting['player.isShowLyricRoma']
|
||||
'player.isPlayLxlrc': LX.AppSetting['player.isPlayLxlrc']
|
||||
'player.playbackRate': LX.AppSetting['player.playbackRate']
|
||||
}
|
||||
|
||||
type WinMainActions = 'get_info' | 'get_status' | 'get_analyser_data_array'
|
||||
|
||||
interface LyricActionBase <A> {
|
||||
action: A
|
||||
}
|
||||
interface LyricActionData<A, D> extends LyricActionBase<A> {
|
||||
data: D
|
||||
}
|
||||
type LyricAction<A, D = undefined> = D extends undefined ? LyricActionBase<A> : LyricActionData<A, D>
|
||||
|
||||
type LyricActions = LyricAction<'set_info', {
|
||||
id: string | null
|
||||
singer: string
|
||||
name: string
|
||||
album: string
|
||||
lrc: string | null
|
||||
tlrc: string | null
|
||||
rlrc: string | null
|
||||
lxlrc: string | null
|
||||
// pic: string | null
|
||||
isPlay: boolean
|
||||
line: number
|
||||
played_time: number
|
||||
}>
|
||||
| LyricAction<'set_status', {
|
||||
isPlay: boolean
|
||||
line: number
|
||||
played_time: number
|
||||
}>
|
||||
| LyricAction<'set_lyric', {
|
||||
lrc: string | null
|
||||
tlrc: string | null
|
||||
rlrc: string | null
|
||||
lxlrc: string | null
|
||||
}>
|
||||
| LyricAction<'set_offset', number>
|
||||
| LyricAction<'set_playbackRate', number>
|
||||
| LyricAction<'set_play', number>
|
||||
| LyricAction<'set_pause'>
|
||||
| LyricAction<'set_stop'>
|
||||
| LyricAction<'send_analyser_data_array', Uint8Array>
|
||||
|
||||
|
||||
interface NewBounds {
|
||||
x: number
|
||||
y: number
|
||||
w: number
|
||||
h: number
|
||||
}
|
||||
}
|
||||
}
|
||||
69
src/common/types/download_list.d.ts
vendored
69
src/common/types/download_list.d.ts
vendored
@@ -1,69 +0,0 @@
|
||||
import { type Message } from '@/lang'
|
||||
|
||||
// interface DownloadList {
|
||||
|
||||
// }
|
||||
|
||||
|
||||
declare global {
|
||||
namespace LX {
|
||||
namespace Download {
|
||||
type DownloadTaskStatus = 'run'
|
||||
| 'waiting'
|
||||
| 'pause'
|
||||
| 'error'
|
||||
| 'completed'
|
||||
|
||||
type FileExt = 'mp3' | 'flac' | 'wav' | 'ape'
|
||||
|
||||
interface ProgressInfo {
|
||||
progress: number
|
||||
speed: string
|
||||
downloaded: number
|
||||
total: number
|
||||
}
|
||||
|
||||
interface DownloadTaskActionBase <A> {
|
||||
action: A
|
||||
}
|
||||
interface DownloadTaskActionData<A, D> extends DownloadTaskActionBase<A> {
|
||||
data: D
|
||||
}
|
||||
type DownloadTaskAction<A, D = undefined> = D extends undefined ? DownloadTaskActionBase<A> : DownloadTaskActionData<A, D>
|
||||
|
||||
type DownloadTaskActions = DownloadTaskAction<'start'>
|
||||
| DownloadTaskAction<'complete'>
|
||||
| DownloadTaskAction<'refreshUrl'>
|
||||
| DownloadTaskAction<'statusText', string>
|
||||
| DownloadTaskAction<'progress', ProgressInfo>
|
||||
| DownloadTaskAction<'error', {
|
||||
error?: keyof Message
|
||||
message?: string
|
||||
}>
|
||||
|
||||
interface ListItem {
|
||||
id: string
|
||||
isComplate: boolean
|
||||
status: DownloadTaskStatus
|
||||
statusText: string
|
||||
downloaded: number
|
||||
total: number
|
||||
progress: number
|
||||
speed: string
|
||||
metadata: {
|
||||
musicInfo: LX.Music.MusicInfoOnline
|
||||
url: string | null
|
||||
quality: LX.Quality
|
||||
ext: FileExt
|
||||
fileName: string
|
||||
filePath: string
|
||||
}
|
||||
}
|
||||
|
||||
interface saveDownloadMusicInfo {
|
||||
list: ListItem[]
|
||||
addMusicLocationType: LX.AddMusicLocationType
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
24
src/common/types/ipc_main.d.ts
vendored
24
src/common/types/ipc_main.d.ts
vendored
@@ -1,24 +0,0 @@
|
||||
declare namespace LX {
|
||||
interface IpcMainEvent {
|
||||
event: Electron.IpcMainEvent
|
||||
}
|
||||
interface IpcMainEventParams<T> {
|
||||
event: Electron.IpcMainEvent
|
||||
params: T
|
||||
}
|
||||
type IpcMainEventListener = (params: LX.IpcMainEvent) => void
|
||||
type IpcMainEventListenerParams<T> = (params: LX.IpcMainEventParams<T>) => void
|
||||
|
||||
interface IpcMainInvokeEvent {
|
||||
event: Electron.IpcMainInvokeEvent
|
||||
}
|
||||
interface IpcMainInvokeEventParams<T> {
|
||||
event: Electron.IpcMainInvokeEvent
|
||||
params: T
|
||||
}
|
||||
|
||||
type IpcMainInvokeEventListener = (params: LX.IpcMainInvokeEvent) => Promise<void>
|
||||
type IpcMainInvokeEventListenerParams<T> = (params: LX.IpcMainInvokeEventParams<T>) => Promise<void>
|
||||
type IpcMainInvokeEventListenerValue<V> = (params: LX.IpcMainInvokeEvent) => Promise<V>
|
||||
type IpcMainInvokeEventListenerParamsValue<T, V> = (params: LX.IpcMainInvokeEventParams<T>) => Promise<V>
|
||||
}
|
||||
11
src/common/types/ipc_renderer.d.ts
vendored
11
src/common/types/ipc_renderer.d.ts
vendored
@@ -1,11 +0,0 @@
|
||||
declare namespace LX {
|
||||
interface IpcRendererEvent {
|
||||
event: Electron.IpcRendererEvent
|
||||
}
|
||||
interface IpcRendererEventParams<T> {
|
||||
event: Electron.IpcRendererEvent
|
||||
params: T
|
||||
}
|
||||
type IpcRendererEventListener = (params: LX.IpcRendererEvent) => any
|
||||
type IpcRendererEventListenerParams<T> = (params: LX.IpcRendererEventParams<T>) => any
|
||||
}
|
||||
144
src/common/types/list.d.ts
vendored
144
src/common/types/list.d.ts
vendored
@@ -1,144 +0,0 @@
|
||||
declare namespace LX {
|
||||
namespace List {
|
||||
interface UserListInfo {
|
||||
id: string
|
||||
name: string
|
||||
// list: LX.Music.MusicInfo[]
|
||||
source?: LX.OnlineSource
|
||||
sourceListId?: string
|
||||
// position?: number
|
||||
locationUpdateTime: number | null
|
||||
}
|
||||
|
||||
interface MyDefaultListInfo {
|
||||
id: 'default'
|
||||
name: 'list__name_default'
|
||||
// name: '试听列表'
|
||||
// list: LX.Music.MusicInfo[]
|
||||
}
|
||||
|
||||
interface MyLoveListInfo {
|
||||
id: 'love'
|
||||
name: 'list__name_love'
|
||||
// name: '我的收藏'
|
||||
// list: LX.Music.MusicInfo[]
|
||||
}
|
||||
|
||||
interface MyTempListInfo {
|
||||
id: 'temp'
|
||||
name: '临时列表'
|
||||
// list: LX.Music.MusicInfo[]
|
||||
// TODO: save default lists info
|
||||
meta: {
|
||||
id?: string
|
||||
}
|
||||
}
|
||||
|
||||
type MyListInfo = MyDefaultListInfo | MyLoveListInfo | UserListInfo
|
||||
|
||||
interface MyAllList {
|
||||
defaultList: MyDefaultListInfo
|
||||
loveList: MyLoveListInfo
|
||||
userList: UserListInfo[]
|
||||
tempList: MyTempListInfo
|
||||
}
|
||||
|
||||
|
||||
type SearchHistoryList = string[]
|
||||
type ListPositionInfo = Record<string, number>
|
||||
type ListUpdateInfo = Record<string, {
|
||||
updateTime: number
|
||||
isAutoUpdate: boolean
|
||||
}>
|
||||
|
||||
type ListSaveType = 'myList' | 'downloadList'
|
||||
type ListSaveInfo = {
|
||||
type: 'myList'
|
||||
data: Partial<MyAllList>
|
||||
} | {
|
||||
type: 'downloadList'
|
||||
data: LX.Download.ListItem[]
|
||||
}
|
||||
|
||||
|
||||
type ListActionDataOverwrite = MakeOptional<LX.List.ListDataFull, 'tempList'>
|
||||
interface ListActionAdd {
|
||||
position: number
|
||||
listInfos: UserListInfo[]
|
||||
}
|
||||
type ListActionRemove = string[]
|
||||
type ListActionUpdate = UserListInfo[]
|
||||
interface ListActionUpdatePosition {
|
||||
/**
|
||||
* 列表id
|
||||
*/
|
||||
ids: string[]
|
||||
/**
|
||||
* 位置
|
||||
*/
|
||||
position: number
|
||||
}
|
||||
|
||||
interface ListActionMusicAdd {
|
||||
id: string
|
||||
musicInfos: LX.Music.MusicInfo[]
|
||||
addMusicLocationType: LX.AddMusicLocationType
|
||||
}
|
||||
|
||||
interface ListActionMusicMove {
|
||||
fromId: string
|
||||
toId: string
|
||||
musicInfos: LX.Music.MusicInfo[]
|
||||
addMusicLocationType: LX.AddMusicLocationType
|
||||
}
|
||||
|
||||
interface ListActionCheckMusicExistList {
|
||||
listId: string
|
||||
musicInfoId: string
|
||||
}
|
||||
|
||||
interface ListActionMusicRemove {
|
||||
listId: string
|
||||
ids: string[]
|
||||
}
|
||||
|
||||
type ListActionMusicUpdate = Array<{
|
||||
id: string
|
||||
musicInfo: LX.Music.MusicInfo
|
||||
}>
|
||||
|
||||
interface ListActionMusicUpdatePosition {
|
||||
listId: string
|
||||
position: number
|
||||
ids: string[]
|
||||
}
|
||||
|
||||
interface ListActionMusicOverwrite {
|
||||
listId: string
|
||||
musicInfos: LX.Music.MusicInfo[]
|
||||
}
|
||||
|
||||
type ListActionMusicClear = string[]
|
||||
|
||||
interface MyDefaultListInfoFull extends MyDefaultListInfo {
|
||||
list: LX.Music.MusicInfo[]
|
||||
}
|
||||
interface MyLoveListInfoFull extends MyLoveListInfo {
|
||||
list: LX.Music.MusicInfo[]
|
||||
}
|
||||
interface UserListInfoFull extends UserListInfo {
|
||||
list: LX.Music.MusicInfo[]
|
||||
}
|
||||
interface MyTempListInfoFull extends MyTempListInfo {
|
||||
list: LX.Music.MusicInfo[]
|
||||
}
|
||||
|
||||
interface ListDataFull {
|
||||
defaultList: LX.Music.MusicInfo[]
|
||||
loveList: LX.Music.MusicInfo[]
|
||||
userList: UserListInfoFull[]
|
||||
tempList: LX.Music.MusicInfo[]
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
122
src/common/types/music.d.ts
vendored
122
src/common/types/music.d.ts
vendored
@@ -1,122 +0,0 @@
|
||||
declare namespace LX {
|
||||
namespace Music {
|
||||
interface MusicQualityType { // {"type": "128k", size: "3.56M"}
|
||||
type: LX.Quality
|
||||
size: string | null
|
||||
}
|
||||
interface MusicQualityTypeKg { // {"type": "128k", size: "3.56M"}
|
||||
type: LX.Quality
|
||||
size: string | null
|
||||
hash: string
|
||||
}
|
||||
type _MusicQualityType = Partial<Record<Quality, {
|
||||
size: string | null
|
||||
}>>
|
||||
type _MusicQualityTypeKg = Partial<Record<Quality, {
|
||||
size: string | null
|
||||
hash: string
|
||||
}>>
|
||||
|
||||
|
||||
interface MusicInfoMetaBase {
|
||||
songId: string | number // 歌曲ID,mg源为copyrightId,local为文件路径
|
||||
albumName: string // 歌曲专辑名称
|
||||
picUrl?: string | null // 歌曲图片链接
|
||||
}
|
||||
|
||||
interface MusicInfoMeta_online extends MusicInfoMetaBase {
|
||||
qualitys: MusicQualityType[]
|
||||
_qualitys: _MusicQualityType
|
||||
albumId?: string | number // 歌曲专辑ID
|
||||
}
|
||||
|
||||
interface MusicInfoMeta_local extends MusicInfoMetaBase {
|
||||
filePath: string
|
||||
ext: string
|
||||
}
|
||||
|
||||
|
||||
interface MusicInfoBase<S = LX.Source> {
|
||||
id: string
|
||||
name: string // 歌曲名
|
||||
singer: string // 艺术家名
|
||||
source: S // 源
|
||||
interval: string | null // 格式化后的歌曲时长,例:03:55
|
||||
meta: MusicInfoMetaBase
|
||||
}
|
||||
|
||||
interface MusicInfoLocal extends MusicInfoBase<'local'> {
|
||||
meta: MusicInfoMeta_local
|
||||
}
|
||||
|
||||
interface MusicInfo_online_common extends MusicInfoBase<'kw' | 'wy'> {
|
||||
meta: MusicInfoMeta_online
|
||||
}
|
||||
|
||||
interface MusicInfoMeta_kg extends MusicInfoMeta_online {
|
||||
qualitys: MusicQualityTypeKg[]
|
||||
_qualitys: _MusicQualityTypeKg
|
||||
hash: string // 歌曲hash
|
||||
}
|
||||
interface MusicInfo_kg extends MusicInfoBase<'kg'> {
|
||||
meta: MusicInfoMeta_kg
|
||||
}
|
||||
|
||||
interface MusicInfoMeta_tx extends MusicInfoMeta_online {
|
||||
strMediaMid: string // 歌曲strMediaMid
|
||||
id?: number // 歌曲songId
|
||||
albumMid?: string // 歌曲albumMid
|
||||
}
|
||||
interface MusicInfo_tx extends MusicInfoBase<'tx'> {
|
||||
meta: MusicInfoMeta_tx
|
||||
}
|
||||
|
||||
interface MusicInfoMeta_mg extends MusicInfoMeta_online {
|
||||
copyrightId: string // 歌曲copyrightId
|
||||
lrcUrl?: string // 歌曲lrcUrl
|
||||
mrcUrl?: string // 歌曲mrcUrl
|
||||
trcUrl?: string // 歌曲trcUrl
|
||||
}
|
||||
interface MusicInfo_mg extends MusicInfoBase<'mg'> {
|
||||
meta: MusicInfoMeta_mg
|
||||
}
|
||||
|
||||
type MusicInfoOnline = MusicInfo_online_common | MusicInfo_kg | MusicInfo_tx | MusicInfo_mg
|
||||
type MusicInfo = MusicInfoOnline | MusicInfoLocal
|
||||
|
||||
interface LyricInfo {
|
||||
// 歌曲歌词
|
||||
lyric: string
|
||||
// 翻译歌词
|
||||
tlyric?: string | null
|
||||
// 罗马音歌词
|
||||
rlyric?: string | null
|
||||
// 逐字歌词
|
||||
lxlyric?: string | null
|
||||
}
|
||||
|
||||
interface LyricInfoSave {
|
||||
id: string
|
||||
lyrics: LyricInfo
|
||||
}
|
||||
|
||||
interface MusicFileMeta {
|
||||
title: string
|
||||
artist: string | null
|
||||
album: string | null
|
||||
APIC: string | null
|
||||
lyrics: string | null
|
||||
}
|
||||
|
||||
interface MusicUrlInfo {
|
||||
id: string
|
||||
url: string
|
||||
}
|
||||
|
||||
interface MusicInfoOtherSourceSave {
|
||||
id: string
|
||||
list: MusicInfoOnline[]
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
11
src/common/types/music_metadata.d.ts
vendored
11
src/common/types/music_metadata.d.ts
vendored
@@ -1,11 +0,0 @@
|
||||
import {
|
||||
type IAudioMetadata as iAudioMetadata,
|
||||
} from 'music-metadata'
|
||||
|
||||
declare global {
|
||||
namespace LX {
|
||||
namespace MusicMetadataModule {
|
||||
type IAudioMetadata = iAudioMetadata
|
||||
}
|
||||
}
|
||||
}
|
||||
19
src/common/types/player.d.ts
vendored
19
src/common/types/player.d.ts
vendored
@@ -1,19 +0,0 @@
|
||||
declare namespace LX {
|
||||
namespace Player {
|
||||
interface ProgressBarOptions {
|
||||
progress: number
|
||||
mode?: Electron.ProgressBarOptions['mode']
|
||||
}
|
||||
|
||||
type StatusButtonActions = 'unCollect'
|
||||
| 'collect'
|
||||
| 'prev'
|
||||
| 'pause'
|
||||
| 'play'
|
||||
| 'next'
|
||||
|
||||
interface LyricInfo extends LX.Music.LyricInfo {
|
||||
rawlrcInfo: LX.Music.LyricInfo
|
||||
}
|
||||
}
|
||||
}
|
||||
10
src/common/types/shims_vue.d.ts
vendored
10
src/common/types/shims_vue.d.ts
vendored
@@ -1,10 +0,0 @@
|
||||
// declare module '*.vue' {
|
||||
// import { App } from 'vue'
|
||||
// export default App.Component
|
||||
// }
|
||||
|
||||
declare module '*.vue' {
|
||||
import { type Component } from 'vue'
|
||||
const component: Component
|
||||
export default component
|
||||
}
|
||||
25
src/common/types/sound_effect.d.ts
vendored
25
src/common/types/sound_effect.d.ts
vendored
@@ -1,25 +0,0 @@
|
||||
declare namespace LX {
|
||||
namespace SoundEffect {
|
||||
interface EQPreset {
|
||||
id: string
|
||||
name: string
|
||||
hz31: number
|
||||
hz62: number
|
||||
hz125: number
|
||||
hz250: number
|
||||
hz500: number
|
||||
hz1000: number
|
||||
hz2000: number
|
||||
hz4000: number
|
||||
hz8000: number
|
||||
hz16000: number
|
||||
}
|
||||
interface ConvolutionPreset {
|
||||
id: string
|
||||
name: string
|
||||
source: string
|
||||
mainGain: number
|
||||
sendGain: number
|
||||
}
|
||||
}
|
||||
}
|
||||
110
src/common/types/sync.d.ts
vendored
110
src/common/types/sync.d.ts
vendored
@@ -1,110 +0,0 @@
|
||||
declare namespace LX {
|
||||
namespace Sync {
|
||||
|
||||
interface EnableServer {
|
||||
enable: boolean
|
||||
port: string
|
||||
}
|
||||
interface EnableClient {
|
||||
enable: boolean
|
||||
host: string
|
||||
authCode?: string
|
||||
}
|
||||
|
||||
interface SyncActionBase <A> {
|
||||
action: A
|
||||
}
|
||||
interface SyncActionData<A, D> extends SyncActionBase<A> {
|
||||
data: D
|
||||
}
|
||||
type SyncAction<A, D = undefined> = D extends undefined ? SyncActionBase<A> : SyncActionData<A, D>
|
||||
|
||||
type SyncMainWindowActions = SyncAction<'select_mode', string>
|
||||
| SyncAction<'close_select_mode'>
|
||||
| SyncAction<'client_status', ClientStatus>
|
||||
| SyncAction<'server_status', ServerStatus>
|
||||
|
||||
type SyncServiceActions = SyncAction<'select_mode', Mode>
|
||||
| SyncAction<'get_server_status'>
|
||||
| SyncAction<'get_client_status'>
|
||||
| SyncAction<'generate_code'>
|
||||
| SyncAction<'enable_server', EnableServer>
|
||||
| SyncAction<'enable_client', EnableClient>
|
||||
|
||||
type ActionList = SyncAction<'list_data_overwrite', LX.List.ListActionDataOverwrite>
|
||||
| SyncAction<'list_create', LX.List.ListActionAdd>
|
||||
| SyncAction<'list_remove', LX.List.ListActionRemove>
|
||||
| SyncAction<'list_update', LX.List.ListActionUpdate>
|
||||
| SyncAction<'list_update_position', LX.List.ListActionUpdatePosition>
|
||||
| SyncAction<'list_music_add', LX.List.ListActionMusicAdd>
|
||||
| SyncAction<'list_music_move', LX.List.ListActionMusicMove>
|
||||
| SyncAction<'list_music_remove', LX.List.ListActionMusicRemove>
|
||||
| SyncAction<'list_music_update', LX.List.ListActionMusicUpdate>
|
||||
| SyncAction<'list_music_update_position', LX.List.ListActionMusicUpdatePosition>
|
||||
| SyncAction<'list_music_overwrite', LX.List.ListActionMusicOverwrite>
|
||||
| SyncAction<'list_music_clear', LX.List.ListActionMusicClear>
|
||||
|
||||
type ActionSync = SyncAction<'list:sync:list_sync_get_md5', string>
|
||||
| SyncAction<'list:sync:list_sync_get_list_data', ListData>
|
||||
| SyncAction<'list:sync:list_sync_get_sync_mode', Mode>
|
||||
| SyncAction<'list:sync:action', ActionList>
|
||||
// | SyncAction<'finished'>
|
||||
|
||||
type ActionSyncType = Actions<ActionSync>
|
||||
|
||||
type ActionSyncSend = SyncAction<'list:sync:list_sync_get_md5'>
|
||||
| SyncAction<'list:sync:list_sync_get_list_data'>
|
||||
| SyncAction<'list:sync:list_sync_get_sync_mode'>
|
||||
| SyncAction<'list:sync:list_sync_set_data', LX.Sync.ListData>
|
||||
| SyncAction<'list:sync:action', ActionList>
|
||||
| SyncAction<'list:sync:finished'>
|
||||
|
||||
type ActionSyncSendType = Actions<ActionSyncSend>
|
||||
|
||||
interface List {
|
||||
action: string
|
||||
data: any
|
||||
}
|
||||
|
||||
interface ServerStatus {
|
||||
status: boolean
|
||||
message: string
|
||||
address: string[]
|
||||
code: string
|
||||
devices: ServerKeyInfo[]
|
||||
}
|
||||
|
||||
interface ClientStatus {
|
||||
status: boolean
|
||||
message: string
|
||||
address: string[]
|
||||
}
|
||||
|
||||
interface ClientKeyInfo {
|
||||
clientId: string
|
||||
key: string
|
||||
serverName: string
|
||||
}
|
||||
|
||||
interface ServerKeyInfo {
|
||||
clientId: string
|
||||
key: string
|
||||
deviceName: string
|
||||
lastSyncDate?: number
|
||||
snapshotKey: string
|
||||
isMobile: boolean
|
||||
}
|
||||
|
||||
type ListData = Omit<LX.List.ListDataFull, 'tempList'>
|
||||
|
||||
type Mode = 'merge_local_remote'
|
||||
| 'merge_remote_local'
|
||||
| 'overwrite_local_remote'
|
||||
| 'overwrite_remote_local'
|
||||
| 'overwrite_local_remote_full'
|
||||
| 'overwrite_remote_local_full'
|
||||
// | 'none'
|
||||
| 'cancel'
|
||||
|
||||
}
|
||||
}
|
||||
305
src/common/types/theme.d.ts
vendored
305
src/common/types/theme.d.ts
vendored
@@ -1,305 +0,0 @@
|
||||
declare namespace LX {
|
||||
|
||||
interface ThemeColors {
|
||||
'--color-000': string
|
||||
'--color-050': string
|
||||
'--color-100': string
|
||||
'--color-150': string
|
||||
'--color-200': string
|
||||
'--color-250': string
|
||||
'--color-300': string
|
||||
'--color-350': string
|
||||
'--color-400': string
|
||||
'--color-450': string
|
||||
'--color-500': string
|
||||
'--color-550': string
|
||||
'--color-600': string
|
||||
'--color-650': string
|
||||
'--color-700': string
|
||||
'--color-750': string
|
||||
'--color-800': string
|
||||
'--color-850': string
|
||||
'--color-900': string
|
||||
'--color-950': string
|
||||
'--color-1000': string
|
||||
|
||||
|
||||
'--color-theme': string
|
||||
|
||||
'--color-primary': string
|
||||
'--color-primary-alpha-100': string
|
||||
'--color-primary-alpha-200': string
|
||||
'--color-primary-alpha-300': string
|
||||
'--color-primary-alpha-400': string
|
||||
'--color-primary-alpha-500': string
|
||||
'--color-primary-alpha-600': string
|
||||
'--color-primary-alpha-700': string
|
||||
'--color-primary-alpha-800': string
|
||||
'--color-primary-alpha-900': string
|
||||
|
||||
'--color-primary-dark-100': string
|
||||
'--color-primary-dark-100-alpha-100': string
|
||||
'--color-primary-dark-100-alpha-200': string
|
||||
'--color-primary-dark-100-alpha-300': string
|
||||
'--color-primary-dark-100-alpha-400': string
|
||||
'--color-primary-dark-100-alpha-500': string
|
||||
'--color-primary-dark-100-alpha-600': string
|
||||
'--color-primary-dark-100-alpha-700': string
|
||||
'--color-primary-dark-100-alpha-800': string
|
||||
'--color-primary-dark-100-alpha-900': string
|
||||
|
||||
'--color-primary-dark-200': string
|
||||
'--color-primary-dark-200-alpha-100': string
|
||||
'--color-primary-dark-200-alpha-200': string
|
||||
'--color-primary-dark-200-alpha-300': string
|
||||
'--color-primary-dark-200-alpha-400': string
|
||||
'--color-primary-dark-200-alpha-500': string
|
||||
'--color-primary-dark-200-alpha-600': string
|
||||
'--color-primary-dark-200-alpha-700': string
|
||||
'--color-primary-dark-200-alpha-800': string
|
||||
'--color-primary-dark-200-alpha-900': string
|
||||
|
||||
'--color-primary-dark-300': string
|
||||
'--color-primary-dark-300-alpha-100': string
|
||||
'--color-primary-dark-300-alpha-200': string
|
||||
'--color-primary-dark-300-alpha-300': string
|
||||
'--color-primary-dark-300-alpha-400': string
|
||||
'--color-primary-dark-300-alpha-500': string
|
||||
'--color-primary-dark-300-alpha-600': string
|
||||
'--color-primary-dark-300-alpha-700': string
|
||||
'--color-primary-dark-300-alpha-800': string
|
||||
'--color-primary-dark-300-alpha-900': string
|
||||
|
||||
'--color-primary-dark-400': string
|
||||
'--color-primary-dark-400-alpha-100': string
|
||||
'--color-primary-dark-400-alpha-200': string
|
||||
'--color-primary-dark-400-alpha-300': string
|
||||
'--color-primary-dark-400-alpha-400': string
|
||||
'--color-primary-dark-400-alpha-500': string
|
||||
'--color-primary-dark-400-alpha-600': string
|
||||
'--color-primary-dark-400-alpha-700': string
|
||||
'--color-primary-dark-400-alpha-800': string
|
||||
'--color-primary-dark-400-alpha-900': string
|
||||
|
||||
'--color-primary-dark-500': string
|
||||
'--color-primary-dark-500-alpha-100': string
|
||||
'--color-primary-dark-500-alpha-200': string
|
||||
'--color-primary-dark-500-alpha-300': string
|
||||
'--color-primary-dark-500-alpha-400': string
|
||||
'--color-primary-dark-500-alpha-500': string
|
||||
'--color-primary-dark-500-alpha-600': string
|
||||
'--color-primary-dark-500-alpha-700': string
|
||||
'--color-primary-dark-500-alpha-800': string
|
||||
'--color-primary-dark-500-alpha-900': string
|
||||
|
||||
'--color-primary-dark-600': string
|
||||
'--color-primary-dark-600-alpha-100': string
|
||||
'--color-primary-dark-600-alpha-200': string
|
||||
'--color-primary-dark-600-alpha-300': string
|
||||
'--color-primary-dark-600-alpha-400': string
|
||||
'--color-primary-dark-600-alpha-500': string
|
||||
'--color-primary-dark-600-alpha-600': string
|
||||
'--color-primary-dark-600-alpha-700': string
|
||||
'--color-primary-dark-600-alpha-800': string
|
||||
'--color-primary-dark-600-alpha-900': string
|
||||
|
||||
'--color-primary-dark-700': string
|
||||
'--color-primary-dark-700-alpha-100': string
|
||||
'--color-primary-dark-700-alpha-200': string
|
||||
'--color-primary-dark-700-alpha-300': string
|
||||
'--color-primary-dark-700-alpha-400': string
|
||||
'--color-primary-dark-700-alpha-500': string
|
||||
'--color-primary-dark-700-alpha-600': string
|
||||
'--color-primary-dark-700-alpha-700': string
|
||||
'--color-primary-dark-700-alpha-800': string
|
||||
'--color-primary-dark-700-alpha-900': string
|
||||
|
||||
'--color-primary-dark-800': string
|
||||
'--color-primary-dark-800-alpha-100': string
|
||||
'--color-primary-dark-800-alpha-200': string
|
||||
'--color-primary-dark-800-alpha-300': string
|
||||
'--color-primary-dark-800-alpha-400': string
|
||||
'--color-primary-dark-800-alpha-500': string
|
||||
'--color-primary-dark-800-alpha-600': string
|
||||
'--color-primary-dark-800-alpha-700': string
|
||||
'--color-primary-dark-800-alpha-800': string
|
||||
'--color-primary-dark-800-alpha-900': string
|
||||
|
||||
'--color-primary-dark-900': string
|
||||
'--color-primary-dark-900-alpha-100': string
|
||||
'--color-primary-dark-900-alpha-200': string
|
||||
'--color-primary-dark-900-alpha-300': string
|
||||
'--color-primary-dark-900-alpha-400': string
|
||||
'--color-primary-dark-900-alpha-500': string
|
||||
'--color-primary-dark-900-alpha-600': string
|
||||
'--color-primary-dark-900-alpha-700': string
|
||||
'--color-primary-dark-900-alpha-800': string
|
||||
'--color-primary-dark-900-alpha-900': string
|
||||
|
||||
'--color-primary-dark-1000': string
|
||||
'--color-primary-dark-1000-alpha-100': string
|
||||
'--color-primary-dark-1000-alpha-200': string
|
||||
'--color-primary-dark-1000-alpha-300': string
|
||||
'--color-primary-dark-1000-alpha-400': string
|
||||
'--color-primary-dark-1000-alpha-500': string
|
||||
'--color-primary-dark-1000-alpha-600': string
|
||||
'--color-primary-dark-1000-alpha-700': string
|
||||
'--color-primary-dark-1000-alpha-800': string
|
||||
'--color-primary-dark-1000-alpha-900': string
|
||||
|
||||
'--color-primary-light-100': string
|
||||
'--color-primary-light-100-alpha-100': string
|
||||
'--color-primary-light-100-alpha-200': string
|
||||
'--color-primary-light-100-alpha-300': string
|
||||
'--color-primary-light-100-alpha-400': string
|
||||
'--color-primary-light-100-alpha-500': string
|
||||
'--color-primary-light-100-alpha-600': string
|
||||
'--color-primary-light-100-alpha-700': string
|
||||
'--color-primary-light-100-alpha-800': string
|
||||
'--color-primary-light-100-alpha-900': string
|
||||
|
||||
'--color-primary-light-200': string
|
||||
'--color-primary-light-200-alpha-100': string
|
||||
'--color-primary-light-200-alpha-200': string
|
||||
'--color-primary-light-200-alpha-300': string
|
||||
'--color-primary-light-200-alpha-400': string
|
||||
'--color-primary-light-200-alpha-500': string
|
||||
'--color-primary-light-200-alpha-600': string
|
||||
'--color-primary-light-200-alpha-700': string
|
||||
'--color-primary-light-200-alpha-800': string
|
||||
'--color-primary-light-200-alpha-900': string
|
||||
|
||||
'--color-primary-light-300': string
|
||||
'--color-primary-light-300-alpha-100': string
|
||||
'--color-primary-light-300-alpha-200': string
|
||||
'--color-primary-light-300-alpha-300': string
|
||||
'--color-primary-light-300-alpha-400': string
|
||||
'--color-primary-light-300-alpha-500': string
|
||||
'--color-primary-light-300-alpha-600': string
|
||||
'--color-primary-light-300-alpha-700': string
|
||||
'--color-primary-light-300-alpha-800': string
|
||||
'--color-primary-light-300-alpha-900': string
|
||||
|
||||
'--color-primary-light-400': string
|
||||
'--color-primary-light-400-alpha-100': string
|
||||
'--color-primary-light-400-alpha-200': string
|
||||
'--color-primary-light-400-alpha-300': string
|
||||
'--color-primary-light-400-alpha-400': string
|
||||
'--color-primary-light-400-alpha-500': string
|
||||
'--color-primary-light-400-alpha-600': string
|
||||
'--color-primary-light-400-alpha-700': string
|
||||
'--color-primary-light-400-alpha-800': string
|
||||
'--color-primary-light-400-alpha-900': string
|
||||
|
||||
'--color-primary-light-500': string
|
||||
'--color-primary-light-500-alpha-100': string
|
||||
'--color-primary-light-500-alpha-200': string
|
||||
'--color-primary-light-500-alpha-300': string
|
||||
'--color-primary-light-500-alpha-400': string
|
||||
'--color-primary-light-500-alpha-500': string
|
||||
'--color-primary-light-500-alpha-600': string
|
||||
'--color-primary-light-500-alpha-700': string
|
||||
'--color-primary-light-500-alpha-800': string
|
||||
'--color-primary-light-500-alpha-900': string
|
||||
|
||||
'--color-primary-light-600': string
|
||||
'--color-primary-light-600-alpha-100': string
|
||||
'--color-primary-light-600-alpha-200': string
|
||||
'--color-primary-light-600-alpha-300': string
|
||||
'--color-primary-light-600-alpha-400': string
|
||||
'--color-primary-light-600-alpha-500': string
|
||||
'--color-primary-light-600-alpha-600': string
|
||||
'--color-primary-light-600-alpha-700': string
|
||||
'--color-primary-light-600-alpha-800': string
|
||||
'--color-primary-light-600-alpha-900': string
|
||||
|
||||
'--color-primary-light-700': string
|
||||
'--color-primary-light-700-alpha-100': string
|
||||
'--color-primary-light-700-alpha-200': string
|
||||
'--color-primary-light-700-alpha-300': string
|
||||
'--color-primary-light-700-alpha-400': string
|
||||
'--color-primary-light-700-alpha-500': string
|
||||
'--color-primary-light-700-alpha-600': string
|
||||
'--color-primary-light-700-alpha-700': string
|
||||
'--color-primary-light-700-alpha-800': string
|
||||
'--color-primary-light-700-alpha-900': string
|
||||
|
||||
'--color-primary-light-800': string
|
||||
'--color-primary-light-800-alpha-100': string
|
||||
'--color-primary-light-800-alpha-200': string
|
||||
'--color-primary-light-800-alpha-300': string
|
||||
'--color-primary-light-800-alpha-400': string
|
||||
'--color-primary-light-800-alpha-500': string
|
||||
'--color-primary-light-800-alpha-600': string
|
||||
'--color-primary-light-800-alpha-700': string
|
||||
'--color-primary-light-800-alpha-800': string
|
||||
'--color-primary-light-800-alpha-900': string
|
||||
|
||||
'--color-primary-light-900': string
|
||||
'--color-primary-light-900-alpha-100': string
|
||||
'--color-primary-light-900-alpha-200': string
|
||||
'--color-primary-light-900-alpha-300': string
|
||||
'--color-primary-light-900-alpha-400': string
|
||||
'--color-primary-light-900-alpha-500': string
|
||||
'--color-primary-light-900-alpha-600': string
|
||||
'--color-primary-light-900-alpha-700': string
|
||||
'--color-primary-light-900-alpha-800': string
|
||||
'--color-primary-light-900-alpha-900': string
|
||||
|
||||
'--color-primary-light-1000': string
|
||||
'--color-primary-light-1000-alpha-100': string
|
||||
'--color-primary-light-1000-alpha-200': string
|
||||
'--color-primary-light-1000-alpha-300': string
|
||||
'--color-primary-light-1000-alpha-400': string
|
||||
'--color-primary-light-1000-alpha-500': string
|
||||
'--color-primary-light-1000-alpha-600': string
|
||||
'--color-primary-light-1000-alpha-700': string
|
||||
'--color-primary-light-1000-alpha-800': string
|
||||
'--color-primary-light-1000-alpha-900': string
|
||||
}
|
||||
|
||||
interface Theme {
|
||||
id: string
|
||||
name: string
|
||||
isDark: boolean
|
||||
isCustom: boolean
|
||||
config: {
|
||||
themeColors: ThemeColors
|
||||
extInfo: {
|
||||
'--color-app-background': string
|
||||
'--color-main-background': string
|
||||
'--color-nav-font': string
|
||||
'--background-image': string
|
||||
'--background-image-position': string
|
||||
'--background-image-size': string
|
||||
|
||||
// 关闭按钮颜色
|
||||
'--color-btn-hide': string
|
||||
'--color-btn-min': string
|
||||
'--color-btn-close': string
|
||||
|
||||
// 徽章颜色
|
||||
'--color-badge-primary': string
|
||||
'--color-badge-secondary': string
|
||||
'--color-badge-tertiary': string
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface ThemeInfo {
|
||||
themes: LX.Theme[]
|
||||
userThemes: LX.Theme[]
|
||||
dataPath: string
|
||||
}
|
||||
|
||||
interface ThemeSetting {
|
||||
shouldUseDarkColors: boolean
|
||||
theme: {
|
||||
id: string
|
||||
name: string
|
||||
isDark: boolean
|
||||
colors: Record<string, string>
|
||||
}
|
||||
}
|
||||
}
|
||||
56
src/common/types/user_api.d.ts
vendored
56
src/common/types/user_api.d.ts
vendored
@@ -1,56 +0,0 @@
|
||||
declare namespace LX {
|
||||
namespace UserApi {
|
||||
type UserApiSourceInfoType = 'music'
|
||||
type UserApiSourceInfoActions = 'musicUrl'
|
||||
|
||||
interface UserApiSourceInfo {
|
||||
name: string
|
||||
type: UserApiSourceInfoType
|
||||
actions: UserApiSourceInfoActions[]
|
||||
qualitys: LX.Quality[]
|
||||
}
|
||||
|
||||
type UserApiSources = Record<LX.Source, UserApiSourceInfo>
|
||||
|
||||
|
||||
interface UserApiInfo {
|
||||
id: string
|
||||
name: string
|
||||
description: string
|
||||
script: string
|
||||
allowShowUpdateAlert: boolean
|
||||
sources?: UserApiSources
|
||||
}
|
||||
|
||||
interface UserApiStatus {
|
||||
status: boolean
|
||||
message?: string
|
||||
apiInfo?: UserApiInfo
|
||||
}
|
||||
|
||||
interface UserApiUpdateInfo {
|
||||
name: string
|
||||
description: string
|
||||
log: string
|
||||
updateUrl?: string
|
||||
}
|
||||
|
||||
interface UserApiRequestParams {
|
||||
requestKey: string
|
||||
data: any
|
||||
}
|
||||
type UserApiRequestCancelParams = string
|
||||
type UserApiSetApiParams = string
|
||||
|
||||
interface UserApiSetAllowUpdateAlertParams {
|
||||
id: string
|
||||
enable: boolean
|
||||
}
|
||||
|
||||
interface ImportUserApi {
|
||||
apiInfo: UserApiInfo
|
||||
apiList: UserApiInfo[]
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
12
src/common/types/utils.d.ts
vendored
12
src/common/types/utils.d.ts
vendored
@@ -1,12 +0,0 @@
|
||||
type MakeOptional<Type, Key extends keyof Type> = Omit<Type, Key> & Partial<Pick<Type, Key>>
|
||||
|
||||
type DeepPartial<T> = {
|
||||
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
||||
}
|
||||
|
||||
type Modify<T, R> = Omit<T, keyof R> & R
|
||||
|
||||
// type UndefinedOrNever = undefined
|
||||
type Actions<T extends { action: string, data?: any }> = {
|
||||
[U in T as U['action']]: 'data' extends keyof U ? U['data'] : undefined
|
||||
}
|
||||
215
src/common/utils.js
Normal file
215
src/common/utils.js
Normal file
@@ -0,0 +1,215 @@
|
||||
const log = require('electron-log')
|
||||
const { defaultSetting, overwriteSetting } = require('./defaultSetting')
|
||||
// const apiSource = require('../renderer/utils/music/api-source-info')
|
||||
const getStore = require('./store')
|
||||
const defaultHotKey = require('./defaultHotKey')
|
||||
|
||||
exports.isLinux = process.platform == 'linux'
|
||||
exports.isWin = process.platform == 'win32'
|
||||
exports.isMac = process.platform == 'darwin'
|
||||
|
||||
|
||||
/**
|
||||
* 生成节流函数
|
||||
* @param {*} fn
|
||||
* @param {*} delay
|
||||
*/
|
||||
exports.throttle = (fn, delay = 100) => {
|
||||
let timer = null
|
||||
let _args = null
|
||||
return function(...args) {
|
||||
_args = args
|
||||
if (timer) return
|
||||
timer = setTimeout(() => {
|
||||
timer = null
|
||||
fn.apply(this, _args)
|
||||
}, delay)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成防抖函数
|
||||
* @param {*} fn
|
||||
* @param {*} delay
|
||||
*/
|
||||
exports.debounce = (fn, delay = 100) => {
|
||||
let timer = null
|
||||
let _args = null
|
||||
return function(...args) {
|
||||
_args = args
|
||||
if (timer) clearTimeout(timer)
|
||||
timer = setTimeout(() => {
|
||||
timer = null
|
||||
fn.apply(this, _args)
|
||||
}, delay)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
exports.log = log
|
||||
|
||||
// https://stackoverflow.com/a/53387532
|
||||
exports.compareVer = (currentVer, targetVer) => {
|
||||
// treat non-numerical characters as lower version
|
||||
// replacing them with a negative number based on charcode of each character
|
||||
const fix = s => `.${s.toLowerCase().charCodeAt(0) - 2147483647}.`
|
||||
|
||||
currentVer = ('' + currentVer).replace(/[^0-9.]/g, fix).split('.')
|
||||
targetVer = ('' + targetVer).replace(/[^0-9.]/g, fix).split('.')
|
||||
let c = Math.max(currentVer.length, targetVer.length)
|
||||
for (let i = 0; i < c; i++) {
|
||||
// convert to integer the most efficient way
|
||||
currentVer[i] = ~~currentVer[i]
|
||||
targetVer[i] = ~~targetVer[i]
|
||||
if (currentVer[i] > targetVer[i]) return 1
|
||||
else if (currentVer[i] < targetVer[i]) return -1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
exports.isObject = item => item && typeof item === 'object' && !Array.isArray(item)
|
||||
|
||||
/**
|
||||
* 对象深度合并
|
||||
* @param {} target 要合并源对象
|
||||
* @param {} source 要合并目标对象
|
||||
*/
|
||||
exports.objectDeepMerge = (target, source, mergedObj) => {
|
||||
if (!mergedObj) {
|
||||
mergedObj = new Set()
|
||||
mergedObj.add(target)
|
||||
}
|
||||
let base = {}
|
||||
Object.keys(source).forEach(item => {
|
||||
if (exports.isObject(source[item])) {
|
||||
if (mergedObj.has(source[item])) return
|
||||
if (!exports.isObject(target[item])) target[item] = {}
|
||||
mergedObj.add(source[item])
|
||||
exports.objectDeepMerge(target[item], source[item], mergedObj)
|
||||
return
|
||||
}
|
||||
base[item] = source[item]
|
||||
})
|
||||
Object.assign(target, base)
|
||||
}
|
||||
|
||||
exports.mergeSetting = (setting, version) => {
|
||||
let defaultSettingCopy = JSON.parse(JSON.stringify(defaultSetting))
|
||||
let overwriteSettingCopy = JSON.parse(JSON.stringify(overwriteSetting))
|
||||
const defaultVersion = defaultSettingCopy.version
|
||||
if (!version) {
|
||||
if (setting) {
|
||||
version = setting.version
|
||||
delete setting.version
|
||||
}
|
||||
}
|
||||
|
||||
if (!setting) {
|
||||
setting = defaultSettingCopy
|
||||
} else if (exports.compareVer(version, defaultVersion) < 0) {
|
||||
exports.objectDeepMerge(defaultSettingCopy, setting)
|
||||
exports.objectDeepMerge(defaultSettingCopy, overwriteSettingCopy)
|
||||
setting = defaultSettingCopy
|
||||
}
|
||||
|
||||
// if (!apiSource.some(api => api.id === setting.apiSource && !api.disabled)) {
|
||||
// let api = apiSource.find(api => !api.disabled)
|
||||
// if (api) setting.apiSource = api.id
|
||||
// }
|
||||
|
||||
return { setting, version: defaultVersion }
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化设置
|
||||
* @param {*} setting
|
||||
* @param {*} isShowErrorAlert
|
||||
*/
|
||||
exports.initSetting = isShowErrorAlert => {
|
||||
const electronStore_list = getStore('playList', true, isShowErrorAlert)
|
||||
const electronStore_config = getStore('config')
|
||||
const electronStore_downloadList = getStore('downloadList')
|
||||
|
||||
let setting = electronStore_config.get('setting')
|
||||
if (setting) {
|
||||
let version = electronStore_config.get('version')
|
||||
if (!version) { // 迁移配置
|
||||
version = electronStore_config.get('setting.version')
|
||||
electronStore_config.set('version', version)
|
||||
electronStore_config.delete('setting.version')
|
||||
const list = electronStore_config.get('list')
|
||||
if (list) {
|
||||
if (list.defaultList) electronStore_list.set('defaultList', list.defaultList)
|
||||
if (list.loveList) electronStore_list.set('loveList', list.loveList)
|
||||
electronStore_config.delete('list')
|
||||
}
|
||||
const downloadList = electronStore_config.get('download')
|
||||
if (downloadList) {
|
||||
if (downloadList.list) electronStore_downloadList.set('list', downloadList.list)
|
||||
electronStore_config.delete('download')
|
||||
}
|
||||
}
|
||||
|
||||
// 迁移列表滚动位置设置 ~0.18.3
|
||||
if (setting.list.scroll) {
|
||||
let scroll = setting.list.scroll
|
||||
electronStore_config.delete('setting.list.scroll')
|
||||
electronStore_config.set('setting.list.isSaveScrollLocation', scroll.enable)
|
||||
delete setting.list.scroll
|
||||
}
|
||||
|
||||
if (setting.player.isShowLyricTransition != null) { // 修正拼写问题 v1.8.2 及以前
|
||||
setting.player.isShowLyricTranslation = setting.player.isShowLyricTransition
|
||||
delete setting.player.isShowLyricTransition
|
||||
}
|
||||
}
|
||||
|
||||
// 从我的列表分离下载列表 v1.7.0 后
|
||||
let downloadList = electronStore_list.get('downloadList')
|
||||
if (downloadList) {
|
||||
electronStore_downloadList.set('list', downloadList)
|
||||
electronStore_list.delete('downloadList')
|
||||
}
|
||||
|
||||
const { version: settingVersion, setting: newSetting } = exports.mergeSetting(setting, electronStore_config.get('version'))
|
||||
|
||||
// 重置 ^0.18.2 排行榜ID
|
||||
if (!newSetting.leaderboard.tabId.includes('__')) newSetting.leaderboard.tabId = 'kw__16'
|
||||
|
||||
// newSetting.controlBtnPosition = 'right'
|
||||
electronStore_config.set({ version: settingVersion, setting: newSetting })
|
||||
return { version: settingVersion, setting: newSetting }
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化快捷键设置
|
||||
*/
|
||||
exports.initHotKey = () => {
|
||||
const electronStore_hotKey = getStore('hotKey')
|
||||
|
||||
let localConfig = electronStore_hotKey.get('local')
|
||||
if (!localConfig) {
|
||||
localConfig = defaultHotKey.local
|
||||
electronStore_hotKey.set('local', localConfig)
|
||||
}
|
||||
|
||||
let globalConfig = electronStore_hotKey.get('global')
|
||||
|
||||
// 移除v1.0.1及之前设置的全局声音媒体快捷键接管
|
||||
if (globalConfig && globalConfig.keys.VolumeUp) {
|
||||
delete globalConfig.keys.VolumeUp
|
||||
delete globalConfig.keys.VolumeDown
|
||||
delete globalConfig.keys.VolumeMute
|
||||
electronStore_hotKey.set('global', globalConfig)
|
||||
}
|
||||
|
||||
if (!globalConfig) {
|
||||
globalConfig = defaultHotKey.global
|
||||
electronStore_hotKey.set('global', globalConfig)
|
||||
}
|
||||
|
||||
return {
|
||||
global: globalConfig,
|
||||
local: localConfig,
|
||||
}
|
||||
}
|
||||
@@ -1,227 +0,0 @@
|
||||
// 非业务工具方法
|
||||
|
||||
/**
|
||||
* 获取两个数之间的随机整数,大于等于min,小于max
|
||||
* @param {*} min
|
||||
* @param {*} max
|
||||
*/
|
||||
export const getRandom = (min: number, max: number): number => Math.floor(Math.random() * (max - min)) + min
|
||||
|
||||
|
||||
export const sizeFormate = (size: number): string => {
|
||||
// https://gist.github.com/thomseddon/3511330
|
||||
if (!size) return '0 B'
|
||||
let units = ['B', 'KB', 'MB', 'GB', 'TB']
|
||||
let number = Math.floor(Math.log(size) / Math.log(1024))
|
||||
return `${(size / Math.pow(1024, Math.floor(number))).toFixed(2)} ${units[number]}`
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串、时间戳等格式转成时间对象
|
||||
* @param date 时间
|
||||
* @returns 时间对象或空字符串
|
||||
*/
|
||||
export const toDateObj = (date: any): Date | '' => {
|
||||
// console.log(date)
|
||||
if (!date) return ''
|
||||
switch (typeof date) {
|
||||
case 'string':
|
||||
if (!date.includes('T')) date = date.split('.')[0].replace(/-/g, '/')
|
||||
// eslint-disable-next-line no-fallthrough
|
||||
case 'number':
|
||||
date = new Date(date)
|
||||
// eslint-disable-next-line no-fallthrough
|
||||
case 'object':
|
||||
break
|
||||
default: return ''
|
||||
}
|
||||
return date
|
||||
}
|
||||
|
||||
const numFix = (n: number): string => n < 10 ? (`0${n}`) : n.toString()
|
||||
/**
|
||||
* 时间格式化
|
||||
* @param _date 时间
|
||||
* @param format Y-M-D h:m:s Y年 M月 D日 h时 m分 s秒
|
||||
*/
|
||||
export const dateFormat = (_date: any, format = 'Y-M-D h:m:s') => {
|
||||
// console.log(date)
|
||||
const date = toDateObj(_date)
|
||||
if (!date) return ''
|
||||
return format
|
||||
.replace('Y', date.getFullYear().toString())
|
||||
.replace('M', numFix(date.getMonth() + 1))
|
||||
.replace('D', numFix(date.getDate()))
|
||||
.replace('h', numFix(date.getHours()))
|
||||
.replace('m', numFix(date.getMinutes()))
|
||||
.replace('s', numFix(date.getSeconds()))
|
||||
}
|
||||
|
||||
|
||||
export const formatPlayTime = (time: number) => {
|
||||
let m = Math.trunc(time / 60)
|
||||
let s = Math.trunc(time % 60)
|
||||
return m == 0 && s == 0 ? '--/--' : numFix(m) + ':' + numFix(s)
|
||||
}
|
||||
|
||||
export const formatPlayTime2 = (time: number) => {
|
||||
let m = Math.trunc(time / 60)
|
||||
let s = Math.trunc(time % 60)
|
||||
return numFix(m) + ':' + numFix(s)
|
||||
}
|
||||
|
||||
|
||||
const encodeNames = {
|
||||
' ': ' ',
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
''': "'",
|
||||
''': "'",
|
||||
} as const
|
||||
export const decodeName = (str: string | null = '') => {
|
||||
return str?.replace(/(?:&|<|>|"|'|'| )/gm, (s: string) => encodeNames[s as keyof typeof encodeNames]) ?? ''
|
||||
}
|
||||
|
||||
export const isUrl = (path: string) => /https?:\/\//.test(path)
|
||||
|
||||
// 解析URL参数为对象
|
||||
export const parseUrlParams = (str: string): Record<string, string> => {
|
||||
const params: Record<string, string> = {}
|
||||
if (typeof str !== 'string') return params
|
||||
const paramsArr = str.split('&')
|
||||
for (const param of paramsArr) {
|
||||
let [key, value] = param.split('=')
|
||||
params[key] = value
|
||||
}
|
||||
return params
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成节流函数
|
||||
* @param fn 回调
|
||||
* @param delay 延迟
|
||||
* @returns
|
||||
*/
|
||||
export function throttle<Args extends any[]>(fn: (...args: Args) => void | Promise<void>, delay = 100) {
|
||||
let timer: NodeJS.Timeout | null = null
|
||||
let _args: Args
|
||||
return (...args: Args) => {
|
||||
_args = args
|
||||
if (timer) return
|
||||
timer = setTimeout(() => {
|
||||
timer = null
|
||||
void fn(..._args)
|
||||
}, delay)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成防抖函数
|
||||
* @param fn 回调
|
||||
* @param delay 延迟
|
||||
* @returns
|
||||
*/
|
||||
export function debounce<Args extends any[]>(fn: (...args: Args) => void | Promise<void>, delay = 100) {
|
||||
let timer: NodeJS.Timeout | null = null
|
||||
let _args: Args
|
||||
return (...args: Args) => {
|
||||
_args = args
|
||||
if (timer) clearTimeout(timer)
|
||||
timer = setTimeout(() => {
|
||||
timer = null
|
||||
void fn(..._args)
|
||||
}, delay)
|
||||
}
|
||||
}
|
||||
|
||||
const fileNameRxp = /[\\/:*?#"<>|]/g
|
||||
export const filterFileName = (name: string): string => name.replace(fileNameRxp, '')
|
||||
|
||||
|
||||
// https://blog.csdn.net/xcxy2015/article/details/77164126#comments
|
||||
/**
|
||||
*
|
||||
* @param a
|
||||
* @param b
|
||||
*/
|
||||
export const similar = (a: string, b: string) => {
|
||||
if (!a || !b) return 0
|
||||
if (a.length > b.length) { // 保证 a <= b
|
||||
let t = b
|
||||
b = a
|
||||
a = t
|
||||
}
|
||||
let al = a.length
|
||||
let bl = b.length
|
||||
let mp = [] // 一个表
|
||||
let i, j, ai, lt, tmp // ai:字符串a的第i个字符。 lt:左上角的值。 tmp:暂存新的值。
|
||||
for (i = 0; i <= bl; i++) mp[i] = i
|
||||
for (i = 1; i <= al; i++) {
|
||||
ai = a.charAt(i - 1)
|
||||
lt = mp[0]
|
||||
mp[0] = mp[0] + 1
|
||||
for (j = 1; j <= bl; j++) {
|
||||
tmp = Math.min(mp[j] + 1, mp[j - 1] + 1, lt + (ai == b.charAt(j - 1) ? 0 : 1))
|
||||
lt = mp[j]
|
||||
mp[j] = tmp
|
||||
}
|
||||
}
|
||||
return 1 - (mp[bl] / bl)
|
||||
}
|
||||
|
||||
/**
|
||||
* 排序字符串
|
||||
* @param arr
|
||||
* @param data
|
||||
*/
|
||||
export const sortInsert = <T>(arr: Array<{ num: number, data: T }>, data: { num: number, data: T }) => {
|
||||
let key = data.num
|
||||
let left = 0
|
||||
let right = arr.length - 1
|
||||
|
||||
while (left <= right) {
|
||||
let middle = Math.trunc((left + right) / 2)
|
||||
if (key == arr[middle].num) {
|
||||
left = middle
|
||||
break
|
||||
} else if (key < arr[middle].num) {
|
||||
right = middle - 1
|
||||
} else {
|
||||
left = middle + 1
|
||||
}
|
||||
}
|
||||
while (left > 0) {
|
||||
if (arr[left - 1].num != key) break
|
||||
left--
|
||||
}
|
||||
|
||||
arr.splice(left, 0, data)
|
||||
}
|
||||
|
||||
export const encodePath = (path: string) => {
|
||||
return encodeURI(path.replaceAll('\\', '/'))
|
||||
}
|
||||
|
||||
|
||||
export const arrPush = <T>(list: T[], newList: T[]) => {
|
||||
for (let i = 0; i * 1000 < newList.length; i++) {
|
||||
list.push(...newList.slice(i * 1000, (i + 1) * 1000))
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
export const arrUnshift = <T>(list: T[], newList: T[]) => {
|
||||
for (let i = 0; i * 1000 < newList.length; i++) {
|
||||
list.splice(i * 1000, 0, ...newList.slice(i * 1000, (i + 1) * 1000))
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
export const arrPushByPosition = <T>(list: T[], newList: T[], position: number) => {
|
||||
for (let i = 0; i * 1000 < newList.length; i++) {
|
||||
list.splice(position + i * 1000, 0, ...newList.slice(i * 1000, (i + 1) * 1000))
|
||||
}
|
||||
return list
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
import Downloader, { type Options as DownloaderOptions } from './Downloader'
|
||||
import { getRequestAgent } from './util'
|
||||
import { sizeFormate } from '@common/utils'
|
||||
import type http from 'http'
|
||||
|
||||
// these are the default options
|
||||
// const options = {
|
||||
// method: 'GET', // Request Method Verb
|
||||
// // Custom HTTP Header ex: Authorization, User-Agent
|
||||
// headers: {},
|
||||
// fileName: '', // Custom filename when saved
|
||||
// override: false, // if true it will override the file, otherwise will append '(number)' to the end of file
|
||||
// forceResume: false, // If the server does not return the "accept-ranges" header, can be force if it does support it
|
||||
// // httpRequestOptions: {}, // Override the http request options
|
||||
// // httpsRequestOptions: {}, // Override the https request options, ex: to add SSL Certs
|
||||
// }
|
||||
|
||||
export interface Options {
|
||||
url: string
|
||||
path: string
|
||||
fileName: string
|
||||
method?: DownloaderOptions['requestOptions']['method']
|
||||
headers?: DownloaderOptions['requestOptions']['headers']
|
||||
forceResume?: boolean
|
||||
proxy?: { host: string, port: number }
|
||||
onCompleted?: () => void
|
||||
onError?: (error: Error) => void
|
||||
onFail?: (response: http.IncomingMessage) => void
|
||||
onStart?: () => void
|
||||
onStop?: () => void
|
||||
onProgress?: (progress: LX.Download.ProgressInfo) => void
|
||||
}
|
||||
const noop = () => {}
|
||||
export const createDownload = ({
|
||||
url,
|
||||
path,
|
||||
fileName,
|
||||
method = 'get',
|
||||
forceResume,
|
||||
proxy,
|
||||
// resumeTime = 5000,
|
||||
onCompleted = noop,
|
||||
onError = noop,
|
||||
onFail = noop,
|
||||
onStart = noop,
|
||||
onStop = noop,
|
||||
onProgress = noop,
|
||||
}: Options) => {
|
||||
const dl = new Downloader(url, path, fileName, {
|
||||
requestOptions: {
|
||||
method,
|
||||
headers: {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36',
|
||||
},
|
||||
agent: getRequestAgent(url, proxy),
|
||||
timeout: 60 * 1000,
|
||||
},
|
||||
|
||||
forceResume,
|
||||
})
|
||||
|
||||
dl.on('completed', () => {
|
||||
onCompleted()
|
||||
}).on('error', (err: any) => {
|
||||
if (err.message === 'socket hang up') return
|
||||
onError(err)
|
||||
}).on('start', () => {
|
||||
onStart()
|
||||
// pauseResumeTimer(dl, resumeTime)
|
||||
}).on('progress', (stats) => {
|
||||
const speed = sizeFormate(stats.speed)
|
||||
onProgress({
|
||||
progress: parseInt(stats.progress.toFixed(2)),
|
||||
speed,
|
||||
downloaded: stats.downloaded,
|
||||
total: stats.total,
|
||||
})
|
||||
// if (debugDownload) {
|
||||
// const downloaded = sizeFormate(stats.downloaded)
|
||||
// const total = sizeFormate(stats.total)
|
||||
// console.log(`${speed}/s - ${progress}% [${downloaded}/${total}]`)
|
||||
// }
|
||||
}).on('stop', () => {
|
||||
onStop()
|
||||
// debugDownload && console.log('paused')
|
||||
}).on('fail', resp => {
|
||||
onFail(resp)
|
||||
// debugDownload && console.log('fail')
|
||||
})
|
||||
|
||||
// debugDownload && console.log('Downloading: ', url)
|
||||
|
||||
dl.start().catch(err => {
|
||||
onError(err)
|
||||
})
|
||||
|
||||
return dl
|
||||
}
|
||||
|
||||
export type DownloaderType = Downloader
|
||||
@@ -1,73 +0,0 @@
|
||||
import { URL } from 'url'
|
||||
import http from 'http'
|
||||
import https from 'https'
|
||||
|
||||
export interface Options {
|
||||
method: 'get' | 'head' | 'delete' | 'patch' | 'post' | 'put'
|
||||
params?: Record<string, string>
|
||||
// body?: Record<string, string>
|
||||
headers?: Record<string, string>
|
||||
timeout?: number
|
||||
agent?: http.Agent
|
||||
}
|
||||
|
||||
const defaultOptions: Options = {
|
||||
method: 'get',
|
||||
}
|
||||
|
||||
type HttpCallback = (res: http.IncomingMessage) => void
|
||||
|
||||
const sendRequest = (url: string, options: Options, callback?: HttpCallback) => {
|
||||
const urlParse = new URL(url)
|
||||
const httpOptions: http.RequestOptions | https.RequestOptions = {
|
||||
host: urlParse.hostname,
|
||||
port: urlParse.port,
|
||||
path: urlParse.pathname + urlParse.search,
|
||||
method: options.method,
|
||||
}
|
||||
|
||||
if (options.params) {
|
||||
(httpOptions.path as string) += `${urlParse.search ? '&' : '?'}${Object.entries(options.params)
|
||||
.map(([key, value]) => `${key}=${encodeURIComponent(value)}`)
|
||||
.join('&')}`
|
||||
}
|
||||
|
||||
if (options.headers) httpOptions.headers = { ...options.headers }
|
||||
|
||||
if (options.agent) httpOptions.agent = options.agent
|
||||
|
||||
return urlParse.protocol == 'https:'
|
||||
? https.request(httpOptions, callback)
|
||||
: http.request(httpOptions, callback)
|
||||
}
|
||||
|
||||
const applyTimeout = (request: http.ClientRequest, time: number) => {
|
||||
let timeout: NodeJS.Timeout | null = setTimeout(() => {
|
||||
timeout = null
|
||||
if (request.destroyed) return
|
||||
request.destroy(new Error('Request timeout'))
|
||||
}, time)
|
||||
request.on('response', () => {
|
||||
if (!timeout) return
|
||||
clearTimeout(timeout)
|
||||
timeout = null
|
||||
})
|
||||
}
|
||||
|
||||
// const isRequireRedirect = (response: http.IncomingMessage) => {
|
||||
// return response.statusCode &&
|
||||
// response.statusCode > 300 &&
|
||||
// response.statusCode < 400 &&
|
||||
// Object.hasOwn(response.headers, 'location') &&
|
||||
// response.headers.location
|
||||
// }
|
||||
|
||||
// export function request(url: string, callback: HttpCallback)
|
||||
// export function request(url: string, options: Partial<Options>, callback: HttpCallback)
|
||||
export function request(url: string, _options: Partial<Options>, callback?: HttpCallback) {
|
||||
let options: Options = { ...defaultOptions, ..._options }
|
||||
const request = sendRequest(url, options, callback)
|
||||
if (options.timeout) applyTimeout(request, options.timeout)
|
||||
return request
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import { httpOverHttp, httpsOverHttp } from 'tunnel'
|
||||
|
||||
export const STATUS = {
|
||||
idle: 'IDLE',
|
||||
init: 'INIT',
|
||||
running: 'RUNNING',
|
||||
paused: 'PAUSED',
|
||||
stopped: 'STOPPED',
|
||||
completed: 'COMPLETED',
|
||||
error: 'ERROR',
|
||||
failed: 'FAILED',
|
||||
} as const
|
||||
|
||||
const httpsRxp = /^https:/
|
||||
export const getRequestAgent = (url: string, proxy?: { host: string, port: number }) => {
|
||||
let options
|
||||
if (proxy) {
|
||||
options = {
|
||||
proxy: {
|
||||
host: proxy.host,
|
||||
port: proxy.port,
|
||||
},
|
||||
}
|
||||
}
|
||||
return options ? (httpsRxp.test(url) ? httpsOverHttp : httpOverHttp)(options) : undefined
|
||||
}
|
||||
@@ -1,183 +0,0 @@
|
||||
// https://github.com/tholman/cursor-effects/blob/master/src/bubbleCursor.js
|
||||
|
||||
class Particle {
|
||||
constructor(x, y, fillStyle, strokeStyle) {
|
||||
const lifeSpan = Math.floor(Math.random() * 60 + 60)
|
||||
this.initialLifeSpan = lifeSpan //
|
||||
this.lifeSpan = lifeSpan // ms
|
||||
this.velocity = {
|
||||
x: (Math.random() < 0.5 ? -1 : 1) * (Math.random() / 10),
|
||||
y: -0.4 + Math.random() * -1,
|
||||
}
|
||||
this.position = { x, y }
|
||||
this.fillStyle = fillStyle
|
||||
this.strokeStyle = strokeStyle
|
||||
|
||||
this.baseDimension = 4
|
||||
}
|
||||
|
||||
update(context, width) {
|
||||
this.position.x += this.velocity.x
|
||||
this.position.y += this.velocity.y
|
||||
|
||||
this.velocity.x += ((Math.random() < 0.5 ? -1 : 1) * 2) / 75
|
||||
this.velocity.y -= Math.random() / 600
|
||||
if (this.position.x >= width - 2 || this.position.x <= 2) this.lifeSpan = 0
|
||||
else if (this.position.y <= 5) this.lifeSpan = 0
|
||||
this.lifeSpan--
|
||||
|
||||
const scale =
|
||||
0.2 + (this.initialLifeSpan - this.lifeSpan) / this.initialLifeSpan
|
||||
|
||||
context.fillStyle = this.fillStyle
|
||||
context.strokeStyle = this.strokeStyle
|
||||
context.beginPath()
|
||||
context.arc(
|
||||
this.position.x - (this.baseDimension / 2) * scale,
|
||||
this.position.y - this.baseDimension / 2,
|
||||
this.baseDimension * scale,
|
||||
0,
|
||||
2 * Math.PI,
|
||||
)
|
||||
|
||||
context.stroke()
|
||||
context.fill()
|
||||
|
||||
context.closePath()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default class BubbleCursor {
|
||||
constructor({ element, fillStyle = 'rgba(77, 175, 124, 0.1)', strokeStyle = 'rgba(77, 175, 124, 0.3)' } = {}) {
|
||||
this.hasWrapperEl = element
|
||||
this.element = this.hasWrapperEl || document.body
|
||||
|
||||
this.width = window.innerWidth
|
||||
this.height = window.innerHeight
|
||||
this.cursor = { x: this.width / 2, y: this.width / 2 }
|
||||
this.particles = []
|
||||
this.canvas = null
|
||||
this.context = null
|
||||
this.fillStyle = fillStyle
|
||||
this.strokeStyle = strokeStyle
|
||||
|
||||
this.init()
|
||||
}
|
||||
|
||||
init() {
|
||||
this.canvas = document.createElement('canvas')
|
||||
this.context = this.canvas.getContext('2d')
|
||||
|
||||
this.canvas.style.top = '0px'
|
||||
this.canvas.style.left = '0px'
|
||||
this.canvas.style.pointerEvents = 'none'
|
||||
this.canvas.style.zIndex = 100
|
||||
|
||||
if (this.hasWrapperEl) {
|
||||
this.canvas.style.position = 'absolute'
|
||||
this.element.appendChild(this.canvas)
|
||||
this.canvas.width = this.element.clientWidth
|
||||
this.canvas.height = this.element.clientHeight
|
||||
} else {
|
||||
this.canvas.style.position = 'fixed'
|
||||
document.body.appendChild(this.canvas)
|
||||
this.canvas.width = this.width
|
||||
this.canvas.height = this.height
|
||||
}
|
||||
|
||||
this.bindEvents()
|
||||
this.loop()
|
||||
}
|
||||
|
||||
bindEvents() {
|
||||
this.element.addEventListener('mousemove', this.onMouseMove)
|
||||
this.element.addEventListener('touchmove', this.onTouchMove, { passive: true })
|
||||
this.element.addEventListener('touchstart', this.onTouchMove, { passive: true })
|
||||
window.addEventListener('resize', this.onWindowResize)
|
||||
}
|
||||
|
||||
|
||||
onWindowResize = (e) => {
|
||||
this.width = window.innerWidth
|
||||
this.height = window.innerHeight
|
||||
|
||||
if (this.hasWrapperEl) {
|
||||
this.canvas.width = this.element.clientWidth
|
||||
this.canvas.height = this.element.clientHeight
|
||||
} else {
|
||||
this.canvas.width = this.width
|
||||
this.canvas.height = this.height
|
||||
}
|
||||
}
|
||||
|
||||
onTouchMove = (e) => {
|
||||
if (e.touches.length > 0) {
|
||||
for (let i = 0; i < e.touches.length; i++) {
|
||||
this.addParticle(
|
||||
e.touches[i].clientX,
|
||||
e.touches[i].clientY,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onMouseMove = (e) => {
|
||||
if (this.hasWrapperEl) {
|
||||
const boundingRect = this.element.getBoundingClientRect()
|
||||
this.cursor.x = e.clientX - boundingRect.left
|
||||
this.cursor.y = e.clientY - boundingRect.top
|
||||
} else {
|
||||
this.cursor.x = e.clientX
|
||||
this.cursor.y = e.clientY
|
||||
}
|
||||
|
||||
this.addParticle(this.cursor.x, this.cursor.y)
|
||||
}
|
||||
|
||||
addParticle(x, y) {
|
||||
this.particles.push(new Particle(x, y, this.fillStyle, this.strokeStyle))
|
||||
}
|
||||
|
||||
updateParticles() {
|
||||
this.context.clearRect(0, 0, this.width, this.height)
|
||||
|
||||
// Update
|
||||
for (let i = 0; i < this.particles.length; i++) {
|
||||
this.particles[i].update(this.context, this.width)
|
||||
}
|
||||
|
||||
// Remove dead particles
|
||||
for (let i = this.particles.length - 1; i >= 0; i--) {
|
||||
if (this.particles[i].lifeSpan < 0) {
|
||||
this.particles.splice(i, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loop = () => {
|
||||
this.updateParticles()
|
||||
window.requestAnimationFrame(this.loop)
|
||||
}
|
||||
|
||||
setColor(fillStyle, strokeStyle) {
|
||||
this.fillStyle = fillStyle
|
||||
this.strokeStyle = strokeStyle
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this.element.removeEventListener('mousemove', this.onMouseMove)
|
||||
this.element.removeEventListener('touchmove', this.onTouchMove, { passive: true })
|
||||
this.element.removeEventListener('touchstart', this.onTouchMove, { passive: true })
|
||||
window.removeEventListener('resize', this.onWindowResize)
|
||||
|
||||
if (this.hasWrapperEl) {
|
||||
this.element.removeChild(this.canvas)
|
||||
} else {
|
||||
document.body.removeChild(this.canvas)
|
||||
}
|
||||
|
||||
this.canvas = null
|
||||
this.context = null
|
||||
}
|
||||
}
|
||||
91
src/common/utils/effects/snow.min.js
vendored
91
src/common/utils/effects/snow.min.js
vendored
@@ -1,91 +0,0 @@
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
// JavaScript Snow Effect - © Copyright 2020 - Jam-Es.com
|
||||
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
|
||||
// Change the following variables to customize the appearance of the particles
|
||||
var numParticles = window.innerWidth / 50;
|
||||
var maxSpeed = 2.5;
|
||||
var minSpeed = 1;
|
||||
var maxSize = 5;
|
||||
var minSize = 3;
|
||||
var maxOpacity = 1;
|
||||
var minOpacity = 0.2;
|
||||
|
||||
// If the following is true, the canvas resolution will be set to match the full viewport width and height.
|
||||
// var fixCanvasResolution = true;
|
||||
|
||||
var snow_particles = [];
|
||||
|
||||
var canvas
|
||||
|
||||
window.onload = function() {
|
||||
canvas = document.createElement('canvas')
|
||||
canvas.style.position = 'fixed';
|
||||
canvas.style.top = '0px'
|
||||
canvas.style.left = '0px'
|
||||
canvas.style.pointerEvents = 'none'
|
||||
canvas.style.zIndex = 100
|
||||
canvas.width = document.documentElement.clientWidth
|
||||
canvas.height = document.documentElement.clientHeight
|
||||
document.body.appendChild(canvas)
|
||||
|
||||
// if (fixCanvasResolution) {
|
||||
// // canvas.width = window.innerWidth;
|
||||
// canvas.height = window.innerHeight;
|
||||
// }
|
||||
|
||||
InitPoints();
|
||||
|
||||
requestAnimationFrame(Redraw, 15);
|
||||
window.addEventListener('resize', this.onWindowResize)
|
||||
}
|
||||
function onWindowResize (e) {
|
||||
canvas.width = document.documentElement.clientWidth
|
||||
canvas.height = document.documentElement.clientHeight
|
||||
}
|
||||
|
||||
function Redraw() {
|
||||
var ctx = canvas.getContext("2d");
|
||||
ctx.clearRect(0,0,canvas.width,canvas.height);
|
||||
for (var i = 0; i < snow_particles.length; i++) {
|
||||
var newYPos = snow_particles[i].yPos + snow_particles[i].speed;
|
||||
if (newYPos > window.innerHeight) {
|
||||
newYPos = getRandomInt(-100,-10);
|
||||
snow_particles[i].xPos = getRandomInt(0, window.innerWidth);
|
||||
snow_particles[i].speed = Math.random() * (maxSpeed - minSpeed) + minSpeed;
|
||||
snow_particles[i].opacity = Math.random() * (maxOpacity - minOpacity) + minOpacity;
|
||||
snow_particles[i].size = Math.random() * (maxSize - minSize) + minSize;
|
||||
}
|
||||
snow_particles[i].yPos = newYPos;
|
||||
ctx.beginPath();
|
||||
ctx.arc(snow_particles[i].xPos, newYPos, snow_particles[i].size, 0, 2 * Math.PI);
|
||||
ctx.fillStyle = "rgba(255, 255, 255, " + snow_particles[i].opacity + ")";
|
||||
ctx.fill();
|
||||
}
|
||||
requestAnimationFrame(Redraw)
|
||||
}
|
||||
|
||||
function InitPoints() {
|
||||
for (var i = 0; i < numParticles; i++) {
|
||||
var startX = getRandomInt(0, window.innerWidth);
|
||||
var startY = getRandomInt(0, window.innerHeight);
|
||||
var speed = Math.random() * (maxSpeed - minSpeed) + minSpeed;
|
||||
var opacity = Math.random() * (maxOpacity - minOpacity) + minOpacity;
|
||||
var size = Math.random() * (maxSize - minSize) + minSize;
|
||||
|
||||
snow_particles.push({
|
||||
"xPos": startX,
|
||||
"yPos": startY,
|
||||
"speed": speed,
|
||||
"opacity": opacity,
|
||||
"size": size,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getRandomInt(min, max) {
|
||||
min = Math.ceil(min);
|
||||
max = Math.floor(max);
|
||||
return Math.floor(Math.random() * (max - min)) + min;
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
import { shell, clipboard } from 'electron'
|
||||
|
||||
|
||||
/**
|
||||
* 在资源管理器中打开目录
|
||||
* @param {string} dir
|
||||
*/
|
||||
export const openDirInExplorer = (dir: string) => {
|
||||
shell.showItemInFolder(dir)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 在浏览器打开URL
|
||||
* @param {*} url
|
||||
*/
|
||||
export const openUrl = async(url: string) => {
|
||||
if (!/^https?:\/\//.test(url)) return
|
||||
await shell.openExternal(url)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 复制文本到剪贴板
|
||||
* @param str
|
||||
*/
|
||||
export const clipboardWriteText = (str: string) => {
|
||||
clipboard.writeText(str)
|
||||
}
|
||||
|
||||
/**
|
||||
* 从剪贴板读取文本
|
||||
* @returns
|
||||
*/
|
||||
export const clipboardReadText = (): string => {
|
||||
return clipboard.readText()
|
||||
}
|
||||
|
||||
|
||||
export const encodePath = (path: string) => {
|
||||
// https://github.com/lyswhut/lx-music-desktop/issues/963
|
||||
return path.replaceAll('%', '%25')
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
import log from 'electron-log'
|
||||
|
||||
log.transports.file.level = 'info'
|
||||
|
||||
export const isLinux = process.platform == 'linux'
|
||||
export const isWin = process.platform == 'win32'
|
||||
export const isMac = process.platform == 'darwin'
|
||||
export const isProd = process.env.NODE_ENV == 'production'
|
||||
|
||||
|
||||
// https://stackoverflow.com/a/53387532
|
||||
export function compareVer(currentVer: string, targetVer: string): -1 | 0 | 1 {
|
||||
// treat non-numerical characters as lower version
|
||||
// replacing them with a negative number based on charcode of each character
|
||||
const fix = (s: string) => `.${s.toLowerCase().charCodeAt(0) - 2147483647}.`
|
||||
|
||||
const currentVerArr: Array<string | number> = ('' + currentVer).replace(/[^0-9.]/g, fix).split('.')
|
||||
const targetVerArr: Array<string | number> = ('' + targetVer).replace(/[^0-9.]/g, fix).split('.')
|
||||
let c = Math.max(currentVerArr.length, targetVerArr.length)
|
||||
for (let i = 0; i < c; i++) {
|
||||
// convert to integer the most efficient way
|
||||
currentVerArr[i] = ~~currentVerArr[i]
|
||||
targetVerArr[i] = ~~targetVerArr[i]
|
||||
if (currentVerArr[i] > targetVerArr[i]) return 1
|
||||
else if (currentVerArr[i] < targetVerArr[i]) return -1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
export {
|
||||
log,
|
||||
}
|
||||
|
||||
export * from './common'
|
||||
@@ -1,366 +0,0 @@
|
||||
const { getNow, TimeoutTools } = require('./utils')
|
||||
|
||||
// const fontFormateRxp = /(?=<\d+,\d+>).*?/g
|
||||
const fontSplitRxp = /(?=<\d+,\d+>).*?/g
|
||||
const timeRxpAll = /<(\d+),(\d+)>/g
|
||||
const timeRxp = /<(\d+),(\d+)>/
|
||||
|
||||
|
||||
// Create animation
|
||||
const createAnimation = (dom, duration, isVertical) => new window.Animation(new window.KeyframeEffect(dom, isVertical
|
||||
? [
|
||||
{ backgroundSize: '100% 0' },
|
||||
{ backgroundSize: '100% 100%' },
|
||||
]
|
||||
: [
|
||||
{ backgroundSize: '0 100%' },
|
||||
{ backgroundSize: '100% 100%' },
|
||||
], {
|
||||
duration,
|
||||
easing: 'linear',
|
||||
},
|
||||
), document.timeline)
|
||||
|
||||
|
||||
// https://jsfiddle.net/ceqpnbky/
|
||||
// https://jsfiddle.net/ceqpnbky/1/
|
||||
|
||||
module.exports = class FontPlayer {
|
||||
constructor({
|
||||
time = 0,
|
||||
rate = 1,
|
||||
lyric = '',
|
||||
lineContentClassName = 'line-content',
|
||||
lineClassName = 'line',
|
||||
shadowClassName = 'shadow',
|
||||
fontModeClassName = 'font-mode',
|
||||
lineModeClassName = 'line-mode',
|
||||
fontLrcClassName = 'font-lrc',
|
||||
extendedLrcClassName = 'extended',
|
||||
shadowContent = false,
|
||||
extendedLyrics = [],
|
||||
isVertical = false,
|
||||
}) {
|
||||
this.time = time
|
||||
this.lyric = lyric
|
||||
|
||||
this._rate = rate
|
||||
|
||||
this.isVertical = isVertical
|
||||
|
||||
this.lineContentClassName = lineContentClassName
|
||||
this.lineClassName = lineClassName
|
||||
|
||||
this.shadowContent = shadowContent
|
||||
this.shadowClassName = shadowClassName
|
||||
|
||||
this.extendedLyrics = extendedLyrics
|
||||
this.fontModeClassName = fontModeClassName
|
||||
this.fontLrcClassName = fontLrcClassName
|
||||
this.extendedLrcClassName = extendedLrcClassName
|
||||
this.lineModeClassName = lineModeClassName
|
||||
|
||||
|
||||
this.isPlay = false
|
||||
this.curFontNum = 0
|
||||
this.maxFontNum = 0
|
||||
this._performanceTime = 0
|
||||
this._startTime = 0
|
||||
|
||||
this.lineContent = null
|
||||
|
||||
this.timeoutTools = new TimeoutTools(80)
|
||||
this.waitPlayTimeout = new TimeoutTools(80)
|
||||
|
||||
this._init()
|
||||
}
|
||||
|
||||
_init() {
|
||||
if (this.lyric == null) this.lyric = ''
|
||||
|
||||
this.isLineMode = false
|
||||
|
||||
this.lineContent = document.createElement('div')
|
||||
this.lineContent.time = this.time
|
||||
this.lineContent.className = this.lineContentClassName
|
||||
|
||||
this.line = document.createElement('div')
|
||||
this.line.style = 'position:relative;display:inline-block;'
|
||||
this.line.className = this.lineClassName
|
||||
this.lineContent.appendChild(this.line)
|
||||
|
||||
this.lrcContent = document.createElement('div')
|
||||
this.lrcContent.className = this.fontLrcClassName
|
||||
// if (this.shadowContent) {
|
||||
// this.lrcShadowContent = document.createElement('div')
|
||||
// this.lrcShadowContent.style = 'position:absolute;top:0;left:0;width:100%;z-index:-1;'
|
||||
// this.lrcShadowContent.className = this.shadowClassName
|
||||
// this.line.appendChild(this.lrcShadowContent)
|
||||
// }
|
||||
this.line.appendChild(this.lrcContent)
|
||||
|
||||
for (const lrc of this.extendedLyrics) {
|
||||
const extendedLrcContent = document.createElement('div')
|
||||
extendedLrcContent.style = 'position:relative;display:inline-block;'
|
||||
extendedLrcContent.className = this.extendedLrcClassName
|
||||
this.lineContent.appendChild(document.createElement('br'))
|
||||
this.lineContent.appendChild(extendedLrcContent)
|
||||
|
||||
|
||||
// if (this.shadowContent) {
|
||||
// const extendedLrcShadowContent = document.createElement('div')
|
||||
// extendedLrcShadowContent.style = 'position:absolute;top:0;left:0;width:100%;z-index:-1;'
|
||||
// extendedLrcShadowContent.className = this.shadowClassName
|
||||
// extendedLrcShadowContent.textContent = lrc
|
||||
// extendedLrcContent.appendChild(extendedLrcShadowContent)
|
||||
// }
|
||||
|
||||
const lineContent = document.createElement('div')
|
||||
lineContent.className = this.fontLrcClassName
|
||||
lineContent.textContent = lrc.replace(timeRxpAll, '')
|
||||
extendedLrcContent.appendChild(lineContent)
|
||||
}
|
||||
this._parseLyric()
|
||||
}
|
||||
|
||||
_parseLyric() {
|
||||
const fonts = this.lyric.split(fontSplitRxp)
|
||||
// console.log(fonts)
|
||||
|
||||
this.maxFontNum = fonts.length - 1
|
||||
this.fonts = []
|
||||
let text
|
||||
// let lineText = ''
|
||||
let lrcShadowContent
|
||||
for (const font of fonts) {
|
||||
text = font.replace(timeRxp, '')
|
||||
if (RegExp.$2 == '') return this._handleLineParse()
|
||||
const time = parseInt(RegExp.$2)
|
||||
|
||||
const dom = document.createElement('span')
|
||||
dom.textContent = text
|
||||
const animation = createAnimation(dom, time / this._rate, this.isVertical)
|
||||
this.lrcContent.appendChild(dom)
|
||||
// lineText += text
|
||||
|
||||
if (this.shadowContent) {
|
||||
lrcShadowContent ??= document.createElement('div')
|
||||
const shadowDom = document.createElement('span')
|
||||
shadowDom.textContent = text
|
||||
lrcShadowContent.appendChild(shadowDom)
|
||||
}
|
||||
// dom.style = shadowDom.style = this.fontStyle
|
||||
// dom.className = shadowDom.className = this.fontClassName
|
||||
|
||||
this.fonts.push({
|
||||
text,
|
||||
startTime: parseInt(RegExp.$1),
|
||||
time,
|
||||
dom,
|
||||
animation,
|
||||
})
|
||||
}
|
||||
|
||||
if (this.shadowContent && lrcShadowContent) {
|
||||
lrcShadowContent.style = 'position:absolute;top:0;left:0;right:0;z-index:-1;'
|
||||
lrcShadowContent.className = this.shadowClassName
|
||||
this.line.appendChild(lrcShadowContent)
|
||||
}
|
||||
|
||||
this.line.appendChild(this.lrcContent)
|
||||
this.fonts.at(-1)?.animation.addEventListener('finish', () => {
|
||||
this.lineContent.classList.add('played')
|
||||
this.isPlay = false
|
||||
})
|
||||
this.lineContent.classList.add(this.fontModeClassName)
|
||||
// if (this.shadowContent) this.lrcShadowContent.textContent = lineText
|
||||
// console.log(this.fonts)
|
||||
}
|
||||
|
||||
_handleLineParse() {
|
||||
this.isLineMode = true
|
||||
this.lineContent.classList.add(this.lineModeClassName)
|
||||
this.lrcContent.textContent = this.lyric
|
||||
|
||||
// if (this.shadowContent) this.lrcShadowContent.textContent = this.lyric
|
||||
this.fonts.push({
|
||||
text: this.lyric,
|
||||
})
|
||||
}
|
||||
|
||||
_currentTime() {
|
||||
return (getNow() - this._performanceTime) * this._rate + this._startTime
|
||||
}
|
||||
|
||||
_findcurFontNum(curTime, startIndex = 0) {
|
||||
const length = this.fonts.length
|
||||
for (let index = startIndex; index < length; index++) if (curTime < this.fonts[index].startTime) return index == 0 ? 0 : index - 1
|
||||
return length - 1
|
||||
}
|
||||
|
||||
_handlePlayMaxFontNum() {
|
||||
let curFont = this.fonts[this.curFontNum]
|
||||
// console.log(curFont.text)
|
||||
const currentTime = this._currentTime()
|
||||
const driftTime = currentTime - curFont.startTime
|
||||
if (currentTime > curFont.startTime + curFont.time) {
|
||||
this._handlePlayFont(curFont, driftTime / this._rate, true)
|
||||
this.lineContent.classList.add('played')
|
||||
this.isPlay = false
|
||||
this.pause()
|
||||
} else {
|
||||
this._handlePlayFont(curFont, driftTime)
|
||||
}
|
||||
}
|
||||
|
||||
_handlePlayFont(font, currentTime, toFinishe) {
|
||||
switch (font.animation.playState) {
|
||||
case 'finished':
|
||||
break
|
||||
case 'idle':
|
||||
font.dom.style.backgroundSize = '100% 100%'
|
||||
if (!toFinishe) font.animation.play()
|
||||
break
|
||||
default:
|
||||
if (toFinishe) {
|
||||
font.animation.cancel()
|
||||
} else {
|
||||
font.animation.currentTime = currentTime
|
||||
font.animation.play()
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
_handlePlayLine(isPlayed) {
|
||||
this.isPlay = false
|
||||
if (isPlayed) {
|
||||
this.lineContent.classList.add('played')
|
||||
} else {
|
||||
this.lineContent.classList.remove('played')
|
||||
}
|
||||
// this.fonts[0].dom.style.backgroundSize = isPlayed ? '100% 100%' : '100% 0'
|
||||
}
|
||||
|
||||
_handlePauseFont(font) {
|
||||
if (font.animation.playState == 'running') font.animation.pause()
|
||||
}
|
||||
|
||||
_refresh() {
|
||||
this.curFontNum++
|
||||
// console.log('curFontNum time', this.fonts[this.curFontNum].time)
|
||||
if (this.curFontNum >= this.maxFontNum) return this._handlePlayMaxFontNum()
|
||||
let curFont = this.fonts[this.curFontNum]
|
||||
// console.log(curFont, nextFont, this.curFontNum, this.maxFontNum)
|
||||
const currentTime = this._currentTime()
|
||||
// console.log(curFont.text)
|
||||
const driftTime = currentTime - curFont.startTime
|
||||
|
||||
// console.log(currentTime, driftTime)
|
||||
|
||||
if (driftTime >= 0 || this.curFontNum == 0) {
|
||||
let nextFont = this.fonts[this.curFontNum + 1]
|
||||
const delay = (nextFont.startTime - curFont.startTime - driftTime) / this._rate
|
||||
if (delay > 0) {
|
||||
if (this.isPlay) {
|
||||
this.timeoutTools.start(() => {
|
||||
if (!this.isPlay) return
|
||||
this._refresh()
|
||||
}, delay)
|
||||
}
|
||||
this._handlePlayFont(curFont, driftTime)
|
||||
return
|
||||
} else {
|
||||
let newCurLineNum = this._findcurFontNum(currentTime, this.curFontNum + 1)
|
||||
if (newCurLineNum > this.curFontNum) this.curFontNum = newCurLineNum - 1
|
||||
for (let i = 0; i <= this.curFontNum; i++) this._handlePlayFont(this.fonts[i], 0, true)
|
||||
this._refresh()
|
||||
return
|
||||
}
|
||||
} else if (this.curFontNum == 0) {
|
||||
this.curFontNum--
|
||||
if (this.isPlay) {
|
||||
this.waitPlayTimeout.start(() => {
|
||||
if (!this.isPlay) return
|
||||
this._refresh()
|
||||
}, -driftTime)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
this.curFontNum = this._findcurFontNum(currentTime, this.curFontNum) - 1
|
||||
for (let i = 0; i <= this.curFontNum; i++) this._handlePlayFont(this.fonts[i], 0, true)
|
||||
// this.curFontNum--
|
||||
this._refresh()
|
||||
}
|
||||
|
||||
play(curTime = 0) {
|
||||
// console.log('play', curTime)
|
||||
if (!this.fonts.length) return
|
||||
this.pause()
|
||||
|
||||
if (this.isLineMode) return this._handlePlayLine(true)
|
||||
this.lineContent.classList.remove('played')
|
||||
this.isPlay = true
|
||||
this._performanceTime = getNow()
|
||||
this._startTime = curTime
|
||||
|
||||
this.curFontNum = this._findcurFontNum(curTime)
|
||||
|
||||
for (let i = this.curFontNum; i > -1; i--) {
|
||||
this._handlePlayFont(this.fonts[i], 0, true)
|
||||
}
|
||||
for (let i = this.curFontNum, len = this.fonts.length; i < len; i++) {
|
||||
let font = this.fonts[i]
|
||||
font.animation.cancel()
|
||||
font.dom.style.backgroundSize = '0 100%'
|
||||
}
|
||||
|
||||
this.curFontNum--
|
||||
|
||||
this._refresh()
|
||||
}
|
||||
|
||||
pause() {
|
||||
if (!this.isPlay) return
|
||||
this.isPlay = false
|
||||
this.timeoutTools.clear()
|
||||
this.waitPlayTimeout.clear()
|
||||
this._handlePauseFont(this.fonts[this.curFontNum])
|
||||
if (this.curFontNum === this.maxLine) return
|
||||
const curFontNum = this._findcurFontNum(this._currentTime())
|
||||
if (this.curFontNum === curFontNum) return
|
||||
for (let i = 0; i < this.curFontNum; i++) this._handlePlayFont(this.fonts[i], 0, true)
|
||||
}
|
||||
|
||||
finish() {
|
||||
this.pause()
|
||||
if (this.isLineMode) return this._handlePlayLine(true)
|
||||
this.lineContent.classList.add('played')
|
||||
|
||||
for (const font of this.fonts) {
|
||||
font.animation.cancel()
|
||||
font.dom.style.backgroundSize = '100% 100%'
|
||||
}
|
||||
this.curFontNum = this.maxFontNum
|
||||
}
|
||||
|
||||
setPlaybackRate(rate) {
|
||||
this._rate = rate
|
||||
if (!this.lines.length) return
|
||||
if (!this.isPlay) return
|
||||
this.play(this._currentTime())
|
||||
}
|
||||
|
||||
reset() {
|
||||
this.pause()
|
||||
if (this.isLineMode) return this._handlePlayLine(false)
|
||||
this.lineContent.classList.remove('played')
|
||||
for (const font of this.fonts) {
|
||||
font.animation.cancel()
|
||||
font.dom.style.backgroundSize = '0 100%'
|
||||
}
|
||||
this.curFontNum = 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,215 +0,0 @@
|
||||
const { getNow, TimeoutTools } = require('./utils')
|
||||
|
||||
const timeFieldExp = /^(?:\[[\d:.]+\])+/g
|
||||
const timeExp = /\d{1,3}(:\d{1,3}){0,2}(?:\.\d{1,3})/g
|
||||
const tagRegMap = {
|
||||
title: 'ti',
|
||||
artist: 'ar',
|
||||
album: 'al',
|
||||
offset: 'offset',
|
||||
by: 'by',
|
||||
}
|
||||
|
||||
const timeoutTools = new TimeoutTools()
|
||||
|
||||
const t_rxp_1 = /^0+(\d+)/
|
||||
const t_rxp_2 = /:0+(\d+)/g
|
||||
const t_rxp_3 = /\.0+(\d+)/
|
||||
const formatTimeLabel = (label) => {
|
||||
return label.replace(t_rxp_1, '$1')
|
||||
.replace(t_rxp_2, ':$1')
|
||||
.replace(t_rxp_3, '.$1')
|
||||
}
|
||||
|
||||
const parseExtendedLyric = (lrcLinesMap, extendedLyric) => {
|
||||
const extendedLines = extendedLyric.split(/\r\n|\n|\r/)
|
||||
for (let i = 0; i < extendedLines.length; i++) {
|
||||
const line = extendedLines[i].trim()
|
||||
let result = timeFieldExp.exec(line)
|
||||
if (result) {
|
||||
const timeField = result[0]
|
||||
const text = line.replace(timeFieldExp, '').trim()
|
||||
if (text) {
|
||||
const times = timeField.match(timeExp)
|
||||
if (times == null) continue
|
||||
for (let time of times) {
|
||||
const timeStr = formatTimeLabel(time)
|
||||
const targetLine = lrcLinesMap[timeStr]
|
||||
if (targetLine) targetLine.extendedLyrics.push(text)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = class LinePlayer {
|
||||
constructor({ offset = 0, rate = 1, onPlay = function() { }, onSetLyric = function() { } } = {}) {
|
||||
this.tags = {}
|
||||
this.lines = null
|
||||
this.onPlay = onPlay
|
||||
this.onSetLyric = onSetLyric
|
||||
this.isPlay = false
|
||||
this.curLineNum = 0
|
||||
this.maxLine = 0
|
||||
this.offset = offset
|
||||
this._performanceTime = 0
|
||||
this._startTime = 0
|
||||
this._rate = rate
|
||||
}
|
||||
|
||||
_init() {
|
||||
if (this.lyric == null) this.lyric = ''
|
||||
if (this.extendedLyrics == null) this.extendedLyrics = []
|
||||
this._initTag()
|
||||
this._initLines()
|
||||
this.onSetLyric(this.lines, this.tags.offset + this.offset)
|
||||
}
|
||||
|
||||
_initTag() {
|
||||
this.tags = {}
|
||||
for (let tag in tagRegMap) {
|
||||
const matches = this.lyric.match(new RegExp(`\\[${tagRegMap[tag]}:([^\\]]*)]`, 'i'))
|
||||
this.tags[tag] = (matches && matches[1]) || ''
|
||||
}
|
||||
if (this.tags.offset) {
|
||||
let offset = parseInt(this.tags.offset)
|
||||
this.tags.offset = Number.isNaN(offset) ? 0 : offset
|
||||
} else {
|
||||
this.tags.offset = 0
|
||||
}
|
||||
}
|
||||
|
||||
_initLines() {
|
||||
this.lines = []
|
||||
const lines = this.lyric.split(/\r\n|\r|\n/)
|
||||
const linesMap = {}
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const line = lines[i].trim()
|
||||
let result = timeFieldExp.exec(line)
|
||||
if (result) {
|
||||
const timeField = result[0]
|
||||
const text = line.replace(timeFieldExp, '').trim()
|
||||
if (text) {
|
||||
const times = timeField.match(timeExp)
|
||||
if (times == null) continue
|
||||
for (let time of times) {
|
||||
const timeStr = formatTimeLabel(time)
|
||||
if (linesMap[timeStr]) {
|
||||
linesMap[timeStr].extendedLyrics.push(text)
|
||||
continue
|
||||
}
|
||||
const timeArr = timeStr.split(':')
|
||||
if (timeArr.length > 3) continue
|
||||
else if (timeArr.length < 3) for (let i = 3 - timeArr.length; i--;) timeArr.unshift('0')
|
||||
if (timeArr[2].indexOf('.') > -1) timeArr.splice(2, 1, ...timeArr[2].split('.'))
|
||||
|
||||
linesMap[timeStr] = {
|
||||
time: parseInt(timeArr[0]) * 60 * 60 * 1000 + parseInt(timeArr[1]) * 60 * 1000 + parseInt(timeArr[2]) * 1000 + parseInt(timeArr[3] || 0),
|
||||
text,
|
||||
extendedLyrics: [],
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const lrc of this.extendedLyrics) parseExtendedLyric(linesMap, lrc)
|
||||
this.lines = Object.values(linesMap)
|
||||
this.lines.sort((a, b) => {
|
||||
return a.time - b.time
|
||||
})
|
||||
this.maxLine = this.lines.length - 1
|
||||
}
|
||||
|
||||
_currentTime() {
|
||||
return (getNow() - this._performanceTime) * this._rate + this._startTime
|
||||
}
|
||||
|
||||
_findCurLineNum(curTime, startIndex = 0) {
|
||||
if (curTime <= 0) return 0
|
||||
const length = this.lines.length
|
||||
for (let index = startIndex; index < length; index++) if (curTime <= this.lines[index].time) return index === 0 ? 0 : index - 1
|
||||
return length - 1
|
||||
}
|
||||
|
||||
_handleMaxLine() {
|
||||
this.onPlay(this.curLineNum, this.lines[this.curLineNum].text, this._currentTime())
|
||||
this.pause()
|
||||
}
|
||||
|
||||
_refresh() {
|
||||
this.curLineNum++
|
||||
// console.log('curLineNum time', this.lines[this.curLineNum].time)
|
||||
if (this.curLineNum >= this.maxLine) return this._handleMaxLine()
|
||||
|
||||
let curLine = this.lines[this.curLineNum]
|
||||
|
||||
const currentTime = this._currentTime()
|
||||
const driftTime = currentTime - curLine.time
|
||||
|
||||
if (driftTime >= 0 || this.curLineNum === 0) {
|
||||
let nextLine = this.lines[this.curLineNum + 1]
|
||||
const delay = (nextLine.time - curLine.time - driftTime) / this._rate
|
||||
|
||||
if (delay > 0) {
|
||||
if (this.isPlay) {
|
||||
timeoutTools.start(() => {
|
||||
if (!this.isPlay) return
|
||||
this._refresh()
|
||||
}, delay)
|
||||
}
|
||||
this.onPlay(this.curLineNum, curLine.text, currentTime)
|
||||
return
|
||||
} else {
|
||||
let newCurLineNum = this._findCurLineNum(currentTime, this.curLineNum + 1)
|
||||
if (newCurLineNum > this.curLineNum) this.curLineNum = newCurLineNum - 1
|
||||
this._refresh()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
this.curLineNum = this._findCurLineNum(currentTime, this.curLineNum) - 1
|
||||
this._refresh()
|
||||
}
|
||||
|
||||
play(curTime = 0) {
|
||||
if (!this.lines.length) return
|
||||
this.pause()
|
||||
this.isPlay = true
|
||||
|
||||
this._performanceTime = getNow() - parseInt(this.tags.offset + this.offset)
|
||||
this._startTime = curTime
|
||||
|
||||
this.curLineNum = this._findCurLineNum(this._currentTime()) - 1
|
||||
|
||||
this._refresh()
|
||||
}
|
||||
|
||||
pause() {
|
||||
if (!this.isPlay) return
|
||||
this.isPlay = false
|
||||
timeoutTools.clear()
|
||||
if (this.curLineNum === this.maxLine) return
|
||||
const currentTime = this._currentTime()
|
||||
const curLineNum = this._findCurLineNum(currentTime)
|
||||
if (this.curLineNum !== curLineNum) {
|
||||
this.curLineNum = curLineNum
|
||||
this.onPlay(curLineNum, this.lines[curLineNum].text, currentTime)
|
||||
}
|
||||
}
|
||||
|
||||
setPlaybackRate(rate) {
|
||||
this._rate = rate
|
||||
if (!this.lines.length) return
|
||||
if (!this.isPlay) return
|
||||
this.play(this._currentTime())
|
||||
}
|
||||
|
||||
setLyric(lyric, extendedLyrics) {
|
||||
// console.log(extendedLyrics)
|
||||
if (this.isPlay) this.pause()
|
||||
this.lyric = lyric
|
||||
this.extendedLyrics = extendedLyrics
|
||||
this._init()
|
||||
}
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
import { compareVer } from './index'
|
||||
|
||||
const oldThemeMap = {
|
||||
0: 'green',
|
||||
1: 'blue',
|
||||
2: 'yellow',
|
||||
3: 'orange',
|
||||
4: 'red',
|
||||
10: 'pink',
|
||||
5: 'purple',
|
||||
6: 'grey',
|
||||
11: 'ming',
|
||||
12: 'blue2',
|
||||
13: 'black',
|
||||
7: 'mid_autumn',
|
||||
8: 'naruto',
|
||||
9: 'happy_new_year',
|
||||
} as const
|
||||
|
||||
export default (setting: any): Partial<LX.AppSetting> => {
|
||||
setting = { ...setting }
|
||||
|
||||
// 迁移 v2.0.0 之前的配置
|
||||
if (compareVer(setting.version, '2.0.0') < 0) {
|
||||
// 迁移列表滚动位置设置 ~0.18.3
|
||||
if (setting.list?.scroll) {
|
||||
let scroll = setting.list.scroll
|
||||
setting.list.isSaveScrollLocation &&= scroll.enable
|
||||
delete setting.list.scroll
|
||||
}
|
||||
|
||||
// 修正拼写问题 v1.8.2 及以前
|
||||
if (setting.player?.isShowLyricTransition != null) {
|
||||
setting.player.isShowLyricTranslation = setting.player.isShowLyricTransition
|
||||
delete setting.player.isShowLyricTransition
|
||||
}
|
||||
|
||||
// 迁移v1.19.0之前的主题设置
|
||||
if (setting.themeId != null) {
|
||||
setting.theme = {
|
||||
id: setting.themeId,
|
||||
}
|
||||
delete setting.themeId
|
||||
}
|
||||
|
||||
if (setting.tray?.isShow != null) setting.tray.enable = setting.tray?.isShow
|
||||
|
||||
setting['common.windowSizeId'] = setting.windowSizeId
|
||||
setting['common.startInFullscreen'] = setting.startInFullscreen
|
||||
setting['common.langId'] = setting.langId
|
||||
setting['common.apiSource'] = setting.apiSource
|
||||
setting['common.sourceNameType'] = setting.sourceNameType
|
||||
setting['common.font'] = setting.font
|
||||
setting['common.isShowAnimation'] = setting.isShowAnimation
|
||||
setting['common.randomAnimate'] = setting.randomAnimate
|
||||
setting['common.isAgreePact'] = setting.isAgreePact
|
||||
setting['common.controlBtnPosition'] = setting.controlBtnPosition
|
||||
|
||||
setting['player.togglePlayMethod'] = setting.player?.togglePlayMethod
|
||||
setting['player.highQuality'] = setting.player?.highQuality
|
||||
setting['player.isShowTaskProgess'] = setting.player?.isShowTaskProgess
|
||||
setting['player.volume'] = setting.player?.volume
|
||||
setting['player.isMute'] = setting.player?.isMute
|
||||
setting['player.mediaDeviceId'] = setting.player?.mediaDeviceId
|
||||
setting['player.isMediaDeviceRemovedStopPlay'] = setting.player?.isMediaDeviceRemovedStopPlay
|
||||
setting['player.isShowLyricTranslation'] = setting.player?.isShowLyricTranslation
|
||||
setting['player.isShowLyricRoma'] = setting.player?.isShowLyricRoma
|
||||
setting['player.isS2t'] = setting.player?.isS2t
|
||||
setting['player.isPlayLxlrc'] = setting.player?.isPlayLxlrc
|
||||
setting['player.isSavePlayTime'] = setting.player?.isSavePlayTime
|
||||
setting['player.audioVisualization'] = setting.player?.audioVisualization
|
||||
setting['player.waitPlayEndStop'] = setting.player?.waitPlayEndStop
|
||||
setting['player.waitPlayEndStopTime'] = setting.player?.waitPlayEndStopTime
|
||||
setting['player.autoSkipOnError'] = setting.player?.autoSkipOnError
|
||||
|
||||
setting['playDetail.isZoomActiveLrc'] = setting.playDetail?.isZoomActiveLrc
|
||||
setting['playDetail.isShowLyricProgressSetting'] = setting.playDetail?.isShowLyricProgressSetting
|
||||
setting['playDetail.style.fontSize'] = setting.playDetail?.style?.fontSize
|
||||
setting['playDetail.style.align'] = setting.playDetail?.style?.align
|
||||
|
||||
setting['desktopLyric.enable'] = setting.desktopLyric?.enable
|
||||
setting['desktopLyric.isLock'] = setting.desktopLyric?.isLock
|
||||
setting['desktopLyric.isAlwaysOnTop'] = setting.desktopLyric?.isAlwaysOnTop
|
||||
setting['desktopLyric.isAlwaysOnTopLoop'] = setting.desktopLyric?.isAlwaysOnTopLoop
|
||||
setting['desktopLyric.width'] = setting.desktopLyric?.width
|
||||
setting['desktopLyric.height'] = setting.desktopLyric?.height
|
||||
setting['desktopLyric.x'] = setting.desktopLyric?.x
|
||||
setting['desktopLyric.y'] = setting.desktopLyric?.y
|
||||
setting['desktopLyric.isLockScreen'] = setting.desktopLyric?.isLockScreen
|
||||
setting['desktopLyric.isDelayScroll'] = setting.desktopLyric?.isDelayScroll
|
||||
setting['desktopLyric.isHoverHide'] = setting.desktopLyric?.isHoverHide
|
||||
setting['desktopLyric.style.font'] = setting.desktopLyric?.style?.font
|
||||
if (setting.desktopLyric?.style?.fontSize) setting['desktopLyric.style.fontSize'] = setting.desktopLyric.style.fontSize / 100 * 16
|
||||
setting['desktopLyric.style.opacity'] = setting.desktopLyric?.style?.opacity
|
||||
setting['desktopLyric.style.isZoomActiveLrc'] = setting.desktopLyric?.style?.isZoomActiveLrc
|
||||
|
||||
setting['list.isClickPlayList'] = setting.list?.isClickPlayList
|
||||
setting['list.isShowAlbumName'] = setting.list?.isShowAlbumName
|
||||
setting['list.isShowSource'] = setting.list?.isShowSource
|
||||
setting['list.isSaveScrollLocation'] = setting.list?.isSaveScrollLocation
|
||||
setting['list.addMusicLocationType'] = setting.list?.addMusicLocationType
|
||||
|
||||
setting['download.enable'] = setting.download?.enable
|
||||
setting['download.savePath'] = setting.download?.savePath
|
||||
setting['download.fileName'] = setting.download?.fileName
|
||||
setting['download.maxDownloadNum'] = setting.download?.maxDownloadNum
|
||||
setting['download.isDownloadLrc'] = setting.download?.isDownloadLrc
|
||||
setting['download.lrcFormat'] = setting.download?.lrcFormat
|
||||
setting['download.isEmbedPic'] = setting.download?.isEmbedPic
|
||||
setting['download.isEmbedLyric'] = setting.download?.isEmbedLyric
|
||||
setting['download.isUseOtherSource'] = setting.download?.isUseOtherSource
|
||||
|
||||
setting['search.isShowHotSearch'] = setting.search?.isShowHotSearch
|
||||
setting['search.isShowHistorySearch'] = setting.search?.isShowHistorySearch
|
||||
setting['search.isFocusSearchBox'] = setting.search?.isFocusSearchBox
|
||||
|
||||
setting['network.proxy.enable'] = setting.network?.proxy?.enable
|
||||
setting['network.proxy.host'] = setting.network?.proxy?.host
|
||||
setting['network.proxy.port'] = setting.network?.proxy?.port
|
||||
setting['network.proxy.username'] = setting.network?.proxy?.username
|
||||
setting['network.proxy.password'] = setting.network?.proxy?.password
|
||||
|
||||
setting['tray.enable'] = setting.tray?.enable
|
||||
setting['tray.themeId'] = setting.tray?.themeId
|
||||
|
||||
|
||||
setting['sync.enable'] = setting.sync?.enable
|
||||
setting['sync.port'] = setting.sync?.port
|
||||
|
||||
setting['theme.id'] = oldThemeMap[setting.theme?.id as keyof typeof oldThemeMap]
|
||||
setting['theme.lightId'] = oldThemeMap[setting.theme?.lightId as keyof typeof oldThemeMap]
|
||||
setting['theme.darkId'] = oldThemeMap[setting.theme?.darkId as keyof typeof oldThemeMap]
|
||||
|
||||
setting['odc.isAutoClearSearchInput'] = setting.odc?.isAutoClearSearchInput
|
||||
setting['odc.isAutoClearSearchList'] = setting.odc?.isAutoClearSearchList
|
||||
|
||||
setting.version = '2.0.0'
|
||||
}
|
||||
|
||||
// 迁移 v2.2.0 之前的设置数据
|
||||
if (compareVer(setting.version, '2.1.0') < 0) {
|
||||
setting['sync.erver.port'] = setting['sync.port']
|
||||
setting.version = '2.1.0'
|
||||
}
|
||||
|
||||
|
||||
return setting
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user