音乐openlist缓存

This commit is contained in:
mtvpls
2026-02-02 20:53:28 +08:00
parent a447a41920
commit 525c6f77aa
7 changed files with 700 additions and 119 deletions
+12 -4
View File
@@ -56,10 +56,6 @@ export interface AdminConfig {
OIDCClientSecret?: string; // OIDC Client Secret
OIDCButtonText?: string; // OIDC登录按钮文字
OIDCMinTrustLevel?: number; // 最低信任等级(仅LinuxDo网站有效,为0时不判断)
// TuneHub音乐配置
TuneHubEnabled?: boolean; // 启用音乐功能
TuneHubBaseUrl?: string; // TuneHub API地址
TuneHubApiKey?: string; // TuneHub API Key
};
UserConfig: {
Users: {
@@ -240,6 +236,18 @@ export interface AdminConfig {
from: string; // 发件人邮箱
};
};
MusicConfig?: {
// TuneHub音乐配置
TuneHubEnabled?: boolean; // 启用音乐功能
TuneHubBaseUrl?: string; // TuneHub API地址
TuneHubApiKey?: string; // TuneHub API Key
// OpenList缓存配置
OpenListCacheEnabled?: boolean; // 启用OpenList缓存
OpenListCacheURL?: string; // OpenList服务器地址
OpenListCacheUsername?: string; // OpenList用户名
OpenListCachePassword?: string; // OpenList密码
OpenListCachePath?: string; // OpenList缓存目录路径
};
}
export interface AdminConfigResult {
+14
View File
@@ -542,6 +542,20 @@ export function configSelfCheck(adminConfig: AdminConfig): AdminConfig {
}
}
// 确保音乐配置存在
if (!adminConfig.MusicConfig) {
adminConfig.MusicConfig = {
TuneHubEnabled: false,
TuneHubBaseUrl: 'https://tunehub.sayqz.com/api',
TuneHubApiKey: '',
OpenListCacheEnabled: false,
OpenListCacheURL: '',
OpenListCacheUsername: '',
OpenListCachePassword: '',
OpenListCachePath: '/music-cache',
};
}
return adminConfig;
}