From 282649aca0b4755ad218bea28b455258342bac15 Mon Sep 17 00:00:00 2001 From: nitezs Date: Fri, 15 Sep 2023 08:51:22 +0800 Subject: [PATCH] fix --- api/controller/default.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/api/controller/default.go b/api/controller/default.go index 4ca33a5..6f9a0c5 100644 --- a/api/controller/default.go +++ b/api/controller/default.go @@ -121,8 +121,25 @@ func MergeSubAndTemplate(temp *model.Subscription, sub *model.Subscription) { // 将订阅中的节点添加到模板中 temp.Proxies = append(temp.Proxies, sub.Proxies...) // 将订阅中的策略组添加到模板中 + skipGroups := []string{"全球直连", "广告拦截", "手动切换"} for i := range temp.ProxyGroups { - temp.ProxyGroups[i].Proxies = append(temp.ProxyGroups[i].Proxies, countryGroupNames...) + skip := false + for _, v := range skipGroups { + if strings.Contains(temp.ProxyGroups[i].Name, v) { + if v == "手动切换" { + proxies := make([]string, 0, len(sub.Proxies)) + for _, p := range sub.Proxies { + proxies = append(proxies, p.Name) + } + temp.ProxyGroups[i].Proxies = proxies + } + skip = true + continue + } + } + if !skip { + temp.ProxyGroups[i].Proxies = append(temp.ProxyGroups[i].Proxies, countryGroupNames...) + } } temp.ProxyGroups = append(temp.ProxyGroups, sub.ProxyGroups...) }