feat: handle remove file source

This commit is contained in:
shinya
2025-07-05 19:44:21 +08:00
parent af539f4b9b
commit 048c34a374

View File

@@ -102,6 +102,15 @@ async function initConfig() {
});
}
});
// 检查现有源是否在 fileConfig.api_site 中,如果不在则标记为 custom
const apiSiteKeys = new Set(apiSiteEntries.map(([key]) => key));
adminConfig.SourceConfig.forEach((source) => {
if (!apiSiteKeys.has(source.key)) {
source.from = 'custom';
}
});
const existedUsers = new Set(
(adminConfig.UserConfig.Users || []).map((u) => u.username)
);