1
0
mirror of https://github.com/nitezs/sub2clash.git synced 2024-12-23 20:24:42 -05:00
This commit is contained in:
Nite07 2023-09-15 00:31:57 +08:00
parent 0f2dba21eb
commit f6273947e7
2 changed files with 6 additions and 7 deletions

View File

@ -2,8 +2,8 @@ name: Build and Push to GHCR
on:
push:
tags:
- '*'
branches:
- dev
workflow_dispatch:
jobs:

View File

@ -107,11 +107,11 @@ func BuildSub(query validator.SubQuery, template string) (
func MergeSubAndTemplate(temp *model.Subscription, sub *model.Subscription) {
// 只合并节点、策略组
// 统计所有国家策略组名称
var newCountryGroupNames []string
var countryGroupNames []string
for _, proxyGroup := range sub.ProxyGroups {
if proxyGroup.IsCountryGrop {
newCountryGroupNames = append(
newCountryGroupNames, proxyGroup.Name,
countryGroupNames = append(
countryGroupNames, proxyGroup.Name,
)
}
}
@ -119,8 +119,7 @@ func MergeSubAndTemplate(temp *model.Subscription, sub *model.Subscription) {
temp.Proxies = append(temp.Proxies, sub.Proxies...)
// 将订阅中的策略组添加到模板中
for i := range temp.ProxyGroups {
temp.ProxyGroups[i].Proxies = append(temp.ProxyGroups[i].Proxies, newCountryGroupNames...)
temp.ProxyGroups[i].Proxies = append(temp.ProxyGroups[i].Proxies, countryGroupNames...)
}
temp.ProxyGroups = append(temp.ProxyGroups, sub.ProxyGroups...)
temp.Rules = append(temp.Rules, sub.Rules...)
}