mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-02-21 09:14:42 +08:00
fix: fix overwrite source disable config
This commit is contained in:
@@ -1 +1 @@
|
||||
20250804185737
|
||||
20250804190750
|
||||
@@ -316,14 +316,24 @@ export async function getConfig(): Promise<AdminConfig> {
|
||||
);
|
||||
|
||||
apiSiteEntries.forEach(([key, site]) => {
|
||||
sourceConfigMap.set(key, {
|
||||
key,
|
||||
name: site.name,
|
||||
api: site.api,
|
||||
detail: site.detail,
|
||||
from: 'config',
|
||||
disabled: false,
|
||||
});
|
||||
const existingSource = sourceConfigMap.get(key);
|
||||
if (existingSource) {
|
||||
// 如果已存在,只覆盖 name、api、detail 和 from
|
||||
existingSource.name = site.name;
|
||||
existingSource.api = site.api;
|
||||
existingSource.detail = site.detail;
|
||||
existingSource.from = 'config';
|
||||
} else {
|
||||
// 如果不存在,创建新条目
|
||||
sourceConfigMap.set(key, {
|
||||
key,
|
||||
name: site.name,
|
||||
api: site.api,
|
||||
detail: site.detail,
|
||||
from: 'config',
|
||||
disabled: false,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 检查现有源是否在 fileConfig.api_site 中,如果不在则标记为 custom
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
'use client';
|
||||
|
||||
const CURRENT_VERSION = '20250804185737';
|
||||
const CURRENT_VERSION = '20250804190750';
|
||||
|
||||
// 版本检查结果枚举
|
||||
export enum UpdateStatus {
|
||||
|
||||
Reference in New Issue
Block a user