Skip to content

Commit 9cfb16b

Browse files
committed
fix: 又忘记格式化了
1 parent 62f0f8f commit 9cfb16b

20 files changed

Lines changed: 26 additions & 90 deletions

File tree

docs/plugins/control.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ splayer.player.on("playStateChange", ({ state, position }) => {
5555
splayer.register({
5656
events: ["trackChange", "lyricChange", "lineChange", "playStateChange"],
5757
controls: true,
58-
settings: [
59-
/* PluginSettingItem[] */
60-
],
58+
settings: [/* PluginSettingItem[] */],
6159
});
6260
```
6361

docs/privacy.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
- **媒体库与播放数据**:您指定的本地文件夹扫描路径、音频文件元数据(曲名、歌手、专辑、流派等)、本地播放列表、歌词缓存及封面缩略图。
3535
- **本地操作日志**:为了帮助您排查软件在运行过程中可能出现的故障,本软件会在您的本地设备中生成运行日志文件。该日志仅保存在您的设备本地,除非您主动提取并提交给开发者寻求帮助,否则不会被自动上传。
3636

37-
3837
## 三、 信息的使用目的与合法依据
3938

4039
我们处理上述信息的目的严格限定于:

electron-builder.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const config: Configuration = {
2626
"!**/*.{d.ts,map,md}",
2727
"!**/{CHANGELOG,LICENSE,license,README,readme}*",
2828
"!**/node_modules/better-sqlite3/deps/**",
29-
"!**/node_modules/better-sqlite3/prebuilds/**",
3029
],
3130
// 保留的语言
3231
electronLanguages: ["zh-CN", "en-US"],

electron/main/database/downloads.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ export const upsert = (task: DownloadTask): void => {
6868
/** 按 id 查 */
6969
export const findById = (taskId: string): DownloadTask | null => {
7070
const raw = getDb().prepare("SELECT * FROM download_tasks WHERE task_id = ?").get(taskId) as
71-
| RawRow
72-
| undefined;
71+
RawRow | undefined;
7372
return raw ? toTask(raw) : null;
7473
};
7574

electron/main/database/lyricMatchCache.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ export const getMatchedId = (fingerprint: string, platform: Platform): MatchedRe
5555
"SELECT platform_id, extra, matched_at FROM lyric_match_cache WHERE fingerprint = ? AND platform = ?",
5656
)
5757
.get(fingerprint, platform) as
58-
| { platform_id: string; extra: string | null; matched_at: number }
59-
| undefined;
58+
{ platform_id: string; extra: string | null; matched_at: number } | undefined;
6059
if (!row) return null;
6160
if (Date.now() - row.matched_at > TTL_MS) return null;
6261
return {

electron/main/database/songCache.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ const toRow = (raw: RawRow): SongCacheRow => ({
4141
*/
4242
export const findByKey = (cacheKey: string): SongCacheRow | null => {
4343
const raw = getDb().prepare("SELECT * FROM song_cache WHERE cache_key = ?").get(cacheKey) as
44-
| RawRow
45-
| undefined;
44+
RawRow | undefined;
4645
return raw ? toRow(raw) : null;
4746
};
4847

@@ -53,8 +52,7 @@ export const findByKey = (cacheKey: string): SongCacheRow | null => {
5352
*/
5453
export const findByFilename = (filename: string): SongCacheRow | null => {
5554
const raw = getDb().prepare("SELECT * FROM song_cache WHERE filename = ?").get(filename) as
56-
| RawRow
57-
| undefined;
55+
RawRow | undefined;
5856
return raw ? toRow(raw) : null;
5957
};
6058

@@ -101,8 +99,7 @@ export const deleteByKey = (cacheKey: string): void => {
10199
*/
102100
export const totalSize = (): number => {
103101
const row = getDb().prepare("SELECT SUM(size) AS total FROM song_cache").get() as
104-
| { total: number | null }
105-
| undefined;
102+
{ total: number | null } | undefined;
106103
return row?.total ?? 0;
107104
};
108105

electron/main/ipc/cache.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ import { defaultCacheDir } from "@main/utils/paths";
2222

2323
/** 已知的缓存类别 */
2424
export type CacheCategory =
25-
| "covers"
26-
| "artists"
27-
| "backgrounds"
28-
| "songs"
29-
| "lyric"
30-
| "lyricTTML"
31-
| "lyricMatch";
25+
"covers" | "artists" | "backgrounds" | "songs" | "lyric" | "lyricTTML" | "lyricMatch";
3226

3327
/** 缓存介质 */
3428
export type CacheKind = "file" | "db";
@@ -100,8 +94,7 @@ const tableSize = (table: string, columns: string[]): number => {
10094
try {
10195
const expr = columns.map((c) => `COALESCE(length(${c}), 0)`).join(" + ");
10296
const row = getDb().prepare(`SELECT SUM(${expr}) AS total FROM ${table}`).get() as
103-
| { total: number | null }
104-
| undefined;
97+
{ total: number | null } | undefined;
10598
return row?.total ?? 0;
10699
} catch {
107100
return 0;
@@ -250,9 +243,8 @@ export const registerCacheIpc = (): void => {
250243
});
251244

252245
/** 歌曲文件级缓存:命中查询 */
253-
ipcMain.handle(
254-
"cache:song:lookup",
255-
(_event, cacheKey: string): Promise<string | null> => songCache.lookup(cacheKey),
246+
ipcMain.handle("cache:song:lookup", (_event, cacheKey: string): Promise<string | null> =>
247+
songCache.lookup(cacheKey),
256248
);
257249

258250
/** 歌曲文件级缓存:排队下载 */

pnpm-workspace.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ minimumReleaseAgeExclude:
1616

1717
overrides:
1818
node-abi: ^4.33.0
19-

shared/types/comment.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ export interface MusicCommentQuery {
5151

5252
/** 评论 IPC 响应 */
5353
export type MusicCommentResponse =
54-
| { ok: true; data: MusicCommentPage }
55-
| { ok: false; error: string };
54+
{ ok: true; data: MusicCommentPage } | { ok: false; error: string };
5655

5756
/** 渲染端评论 API */
5857
export interface CommentsApi {

shared/types/download.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ export type DownloadFolderScheme = "none" | "artist" | "artist-album";
1414

1515
/** 下载任务状态 */
1616
export type DownloadStatus =
17-
| "queued"
18-
| "downloading"
19-
| "done"
20-
| "failed"
21-
| "canceled"
22-
| "interrupted";
17+
"queued" | "downloading" | "done" | "failed" | "canceled" | "interrupted";
2318

2419
/** 写入选项 */
2520
export interface DownloadTagOptions {

0 commit comments

Comments
 (0)