mirror of
https://gitea.redwind.top/Austin/subscription
synced 2024-11-17 01:23:42 +08:00
feat: 新增仅开屏广告的订阅
This commit is contained in:
parent
081f486747
commit
968c2178d5
13
src/file.ts
13
src/file.ts
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user