订阅支持自动添加和删除任务设置

This commit is contained in:
whyour
2023-02-09 00:20:28 +08:00
parent 46c9774efa
commit 76fa82c3a7
7 changed files with 96 additions and 17 deletions
+7 -2
View File
@@ -84,13 +84,17 @@ export default class SubscriptionService {
branch,
extensions,
proxy,
autoAddCron,
autoDelCron,
} = doc;
if (type === 'file') {
command += `raw "${_url}"`;
} else {
command += `repo "${_url}" "${whitelist || ''}" "${blacklist || ''}" "${
dependences || ''
}" "${branch || ''}" "${extensions || ''}" "${proxy || ''}"`;
}" "${branch || ''}" "${extensions || ''}" "${proxy || ''}" "${
Boolean(autoAddCron) || ''
}" "${Boolean(autoDelCron) || ''}"`;
}
return command;
}
@@ -280,7 +284,8 @@ export default class SubscriptionService {
}
public async update(payload: Subscription): Promise<Subscription> {
const newDoc = await this.updateDb(payload);
const tab = new Subscription(payload);
const newDoc = await this.updateDb(tab);
await this.handleTask(newDoc, !newDoc.is_disabled);
return newDoc;
}