Compare commits

..

2 Commits

Author SHA1 Message Date
zu1k
03cf8c6c22 fix name reindex 2020-08-26 13:41:12 +08:00
zu1k
60009fedea fix country filter 2020-08-26 13:26:18 +08:00
2 changed files with 3 additions and 3 deletions

View File

@@ -54,7 +54,7 @@ func (c Clash) Provide() string {
}
if !noNeedFilterCountry {
for _, c := range countries {
if strings.HasPrefix(p.BaseInfo().Name, c) {
if strings.Contains(p.BaseInfo().Name, c) {
countryOk = true
break
}

View File

@@ -3,6 +3,7 @@ package proxy
import (
"fmt"
"sort"
"strings"
"sync"
)
@@ -94,8 +95,7 @@ func (ps ProxyList) NameReIndex() ProxyList {
num := len(ps)
for i := 0; i < num; i++ {
originName := ps[i].BaseInfo().Name
// country := string([]rune(originName)[:2])
country := string([]rune(originName)[:5])
country := strings.SplitN(originName, "_", 2)[0]
ps[i].SetName(fmt.Sprintf("%s_%+02v", country, i+1))
}
return ps