Skip to content

Commit e3dcde7

Browse files
committed
Merge branch 'dev-lyric' into dev
2 parents 7de1355 + 39c35e8 commit e3dcde7

28 files changed

Lines changed: 1720 additions & 2447 deletions

auto-imports.d.ts

Lines changed: 294 additions & 294 deletions
Large diffs are not rendered by default.

components.d.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
/* eslint-disable */
22
// @ts-nocheck
3+
// biome-ignore lint: disable
4+
// oxlint-disable
5+
// ------
36
// Generated by unplugin-vue-components
47
// Read more: https://github.com/vuejs/core/pull/3399
5-
// biome-ignore lint: disable
8+
69
export {}
710

811
/* prettier-ignore */
@@ -61,15 +64,19 @@ declare module 'vue' {
6164
NDrawerContent: typeof import('naive-ui')['NDrawerContent']
6265
NDropdown: typeof import('naive-ui')['NDropdown']
6366
NDynamicTags: typeof import('naive-ui')['NDynamicTags']
67+
NEllipsis: typeof import('naive-ui')['NEllipsis']
6468
NEmpty: typeof import('naive-ui')['NEmpty']
6569
NFlex: typeof import('naive-ui')['NFlex']
70+
NFloatButton: typeof import('naive-ui')['NFloatButton']
71+
NFloatButtonGroup: typeof import('naive-ui')['NFloatButtonGroup']
6672
NForm: typeof import('naive-ui')['NForm']
6773
NFormItem: typeof import('naive-ui')['NFormItem']
6874
NFormItemGi: typeof import('naive-ui')['NFormItemGi']
6975
NGi: typeof import('naive-ui')['NGi']
7076
NGlobalStyle: typeof import('naive-ui')['NGlobalStyle']
7177
NGrid: typeof import('naive-ui')['NGrid']
7278
NH1: typeof import('naive-ui')['NH1']
79+
NH2: typeof import('naive-ui')['NH2']
7380
NH3: typeof import('naive-ui')['NH3']
7481
NIcon: typeof import('naive-ui')['NIcon']
7582
NImage: typeof import('naive-ui')['NImage']
@@ -93,14 +100,18 @@ declare module 'vue' {
93100
NP: typeof import('naive-ui')['NP']
94101
NPopconfirm: typeof import('naive-ui')['NPopconfirm']
95102
NPopover: typeof import('naive-ui')['NPopover']
103+
NProgress: typeof import('naive-ui')['NProgress']
96104
NQrCode: typeof import('naive-ui')['NQrCode']
97105
NRadio: typeof import('naive-ui')['NRadio']
98106
NRadioGroup: typeof import('naive-ui')['NRadioGroup']
107+
NResult: typeof import('naive-ui')['NResult']
99108
NScrollbar: typeof import('naive-ui')['NScrollbar']
100109
NSelect: typeof import('naive-ui')['NSelect']
101110
NSkeleton: typeof import('naive-ui')['NSkeleton']
102111
NSlider: typeof import('naive-ui')['NSlider']
112+
NSpin: typeof import('naive-ui')['NSpin']
103113
NSwitch: typeof import('naive-ui')['NSwitch']
114+
NTab: typeof import('naive-ui')['NTab']
104115
NTabPane: typeof import('naive-ui')['NTabPane']
105116
NTabs: typeof import('naive-ui')['NTabs']
106117
NTag: typeof import('naive-ui')['NTag']

electron/main/ipc/ipc-file.ts

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,20 +199,50 @@ const initFileIpc = (): void => {
199199
// 读取本地歌词
200200
ipcMain.handle(
201201
"read-local-lyric",
202-
async (_, lyricDir: string, id: number, ext: string): Promise<string> => {
203-
const pattern = `**/{,*.}${id}.${ext}`;
202+
async (_, lyricDirs: string[], id: number): Promise<{ lrc: string; ttml: string }> => {
203+
const result = { lrc: "", ttml: "" };
204+
204205
try {
205-
const files = await FastGlob(pattern, { cwd: lyricDir });
206-
if (files.length > 0) {
207-
const firstMatch = join(lyricDir, files[0]);
208-
await access(firstMatch);
209-
const lyric = await readFile(firstMatch, "utf-8");
210-
if (lyric) return lyric;
206+
// 定义需要查找的模式
207+
const patterns = {
208+
ttml: `**/${id}.ttml`,
209+
lrc: `**/${id}.lrc`,
210+
};
211+
212+
// 遍历每一个目录
213+
for (const dir of lyricDirs) {
214+
try {
215+
// 查找 ttml
216+
if (!result.ttml) {
217+
const ttmlFiles = await FastGlob(patterns.ttml, { cwd: dir });
218+
if (ttmlFiles.length > 0) {
219+
const filePath = join(dir, ttmlFiles[0]);
220+
await access(filePath);
221+
result.ttml = await readFile(filePath, "utf-8");
222+
}
223+
}
224+
225+
// 查找 lrc
226+
if (!result.lrc) {
227+
const lrcFiles = await FastGlob(patterns.lrc, { cwd: dir });
228+
if (lrcFiles.length > 0) {
229+
const filePath = join(dir, lrcFiles[0]);
230+
await access(filePath);
231+
result.lrc = await readFile(filePath, "utf-8");
232+
}
233+
}
234+
235+
// 如果两种文件都找到了就提前结束搜索
236+
if (result.ttml && result.lrc) break;
237+
} catch {
238+
// 某个路径异常,跳过
239+
}
211240
}
212241
} catch {
213-
/* empty */
242+
/* 忽略错误 */
214243
}
215-
return "";
244+
245+
return result;
216246
},
217247
);
218248

package.json

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@electron-toolkit/utils": "^4.0.0",
4141
"@imsyy/color-utils": "^1.0.2",
4242
"@material/material-color-utilities": "^0.3.0",
43-
"@neteasecloudmusicapienhanced/api": "^4.29.16",
43+
"@neteasecloudmusicapienhanced/api": "^4.29.17",
4444
"@pixi/app": "^7.4.3",
4545
"@pixi/core": "^7.4.3",
4646
"@pixi/display": "^7.4.3",
@@ -52,7 +52,7 @@
5252
"axios": "^1.13.2",
5353
"axios-retry": "^4.5.0",
5454
"change-case": "^5.4.4",
55-
"dayjs": "^1.11.18",
55+
"dayjs": "^1.11.19",
5656
"electron-dl": "^4.0.0",
5757
"electron-store": "^11.0.2",
5858
"electron-updater": "^6.6.2",
@@ -66,11 +66,11 @@
6666
"jss-preset-default": "^10.10.0",
6767
"localforage": "^1.10.0",
6868
"lodash-es": "^4.17.21",
69-
"marked": "^16.4.0",
69+
"marked": "^16.4.2",
7070
"md5": "^2.3.0",
71-
"music-metadata": "^11.9.0",
72-
"pinia": "^3.0.3",
73-
"pinia-plugin-persistedstate": "^4.5.0",
71+
"music-metadata": "^11.10.0",
72+
"pinia": "^3.0.4",
73+
"pinia-plugin-persistedstate": "^4.7.1",
7474
"plyr": "^3.8.3",
7575
"vue-virt-list": "^1.6.1"
7676
},
@@ -80,40 +80,40 @@
8080
"@electron-toolkit/utils": "^4",
8181
"@fastify/cookie": "^11.0.2",
8282
"@fastify/http-proxy": "^11.3.0",
83-
"@fastify/multipart": "^9.2.1",
84-
"@fastify/static": "^8.2.0",
83+
"@fastify/multipart": "^9.3.0",
84+
"@fastify/static": "^8.3.0",
8585
"@types/file-saver": "^2.0.7",
8686
"@types/howler": "^2.2.12",
8787
"@types/js-cookie": "^3.0.6",
88-
"@types/md5": "^2.3.5",
89-
"@types/node": "^24.7.2",
90-
"@typescript-eslint/eslint-plugin": "^8.46.0",
91-
"@typescript-eslint/parser": "^8.46.0",
88+
"@types/md5": "^2.3.6",
89+
"@types/node": "^24.10.1",
90+
"@typescript-eslint/eslint-plugin": "^8.46.4",
91+
"@typescript-eslint/parser": "^8.46.4",
9292
"@vitejs/plugin-vue": "^6.0.1",
9393
"ajv": "^8.17.1",
9494
"crypto-js": "^4.2.0",
9595
"electron": "38.2.2",
9696
"electron-builder": "^26.0.12",
9797
"electron-log": "^5.4.3",
9898
"electron-vite": "^4.0.1",
99-
"eslint": "^9.37.0",
100-
"eslint-plugin-vue": "^10.5.0",
99+
"eslint": "^9.39.1",
100+
"eslint-plugin-vue": "^10.5.1",
101101
"fast-glob": "^3.3.3",
102-
"fastify": "^5.6.1",
102+
"fastify": "^5.6.2",
103103
"naive-ui": "^2.43.1",
104104
"node-taglib-sharp": "^6.0.1",
105105
"prettier": "^3.6.2",
106-
"sass": "^1.93.2",
107-
"terser": "^5.44.0",
106+
"sass": "^1.94.0",
107+
"terser": "^5.44.1",
108108
"typescript": "^5.9.3",
109109
"unplugin-auto-import": "^20.2.0",
110-
"unplugin-vue-components": "^29.1.0",
110+
"unplugin-vue-components": "^29.2.0",
111111
"vite": "^7.2.2",
112112
"vite-plugin-compression": "^0.5.1",
113113
"vite-plugin-vue-devtools": "^8.0.3",
114114
"vite-plugin-wasm": "^3.5.0",
115115
"vue": "^3.5.24",
116-
"vue-router": "^4.5.1",
116+
"vue-router": "^4.6.3",
117117
"vue-tsc": "^3.1.3"
118118
},
119119
"pnpm": {
@@ -122,7 +122,9 @@
122122
"electron-builder-squirrel-windows": "26.0.12"
123123
},
124124
"onlyBuiltDependencies": [
125+
"@applemusic-like-lyrics/core",
125126
"@applemusic-like-lyrics/lyric",
127+
"@applemusic-like-lyrics/vue",
126128
"@parcel/watcher",
127129
"core-js",
128130
"electron",

0 commit comments

Comments
 (0)