mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-03-06 20:17:32 +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]) => {
|
apiSiteEntries.forEach(([key, site]) => {
|
||||||
sourceConfigMap.set(key, {
|
const existingSource = sourceConfigMap.get(key);
|
||||||
key,
|
if (existingSource) {
|
||||||
name: site.name,
|
// 如果已存在,只覆盖 name、api、detail 和 from
|
||||||
api: site.api,
|
existingSource.name = site.name;
|
||||||
detail: site.detail,
|
existingSource.api = site.api;
|
||||||
from: 'config',
|
existingSource.detail = site.detail;
|
||||||
disabled: false,
|
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
|
// 检查现有源是否在 fileConfig.api_site 中,如果不在则标记为 custom
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
const CURRENT_VERSION = '20250804185737';
|
const CURRENT_VERSION = '20250804190750';
|
||||||
|
|
||||||
// 版本检查结果枚举
|
// 版本检查结果枚举
|
||||||
export enum UpdateStatus {
|
export enum UpdateStatus {
|
||||||
|
|||||||
Reference in New Issue
Block a user