mirror of
https://github.com/SagerNet/sing-geosite.git
synced 2025-02-06 12:52:42 +08:00
Merge category-*-cn to geolocation-cn
This commit is contained in:
parent
d4b71e0c8d
commit
19b54b9626
16
main.go
16
main.go
@ -266,6 +266,18 @@ func mergeTags(data map[string][]geosite.Item) {
|
|||||||
}
|
}
|
||||||
cnCodeList = append(cnCodeList, code)
|
cnCodeList = append(cnCodeList, code)
|
||||||
}
|
}
|
||||||
|
for _, code := range codeList {
|
||||||
|
if !strings.HasPrefix(code, "category-") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if !strings.HasSuffix(code, "-cn") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if strings.Contains(code, "@") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
cnCodeList = append(cnCodeList, code)
|
||||||
|
}
|
||||||
newMap := make(map[geosite.Item]bool)
|
newMap := make(map[geosite.Item]bool)
|
||||||
for _, item := range data["geolocation-cn"] {
|
for _, item := range data["geolocation-cn"] {
|
||||||
newMap[item] = true
|
newMap[item] = true
|
||||||
@ -280,6 +292,10 @@ func mergeTags(data map[string][]geosite.Item) {
|
|||||||
newList = append(newList, item)
|
newList = append(newList, item)
|
||||||
}
|
}
|
||||||
data["geolocation-cn"] = newList
|
data["geolocation-cn"] = newList
|
||||||
|
data["cn"] = append(newList, geosite.Item{
|
||||||
|
Type: geosite.RuleTypeDomainSuffix,
|
||||||
|
Value: "cn",
|
||||||
|
})
|
||||||
println("merged cn categories: " + strings.Join(cnCodeList, ","))
|
println("merged cn categories: " + strings.Join(cnCodeList, ","))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user