feat: 新增仅开屏广告的订阅

This commit is contained in:
lisonge 2023-11-19 00:28:27 +08:00
parent 081f486747
commit 968c2178d5

View File

@ -77,6 +77,19 @@ export const writeConfig = async (config: SubscriptionConfig) => {
const buffer = Buffer.from(orderdStringify(newConfig, sortKeys), 'utf-8');
await fs.writeFile(gkdFp, buffer);
// update gkd.openad.json
const onlyOpenAdConfig = _.cloneDeep(newConfig);
onlyOpenAdConfig.apps.forEach((a) => {
a.groups?.forEach((g) => {
g.enable = g.name.startsWith('开屏广告');
});
});
await fs.writeFile(
process.cwd() + '/dist/gkd.openad.json',
orderdStringify(onlyOpenAdConfig, sortKeys),
'utf-8',
);
// update gkd.version.json
await fs.writeFile(
versionFp,