fix numbered external links #774
This commit is contained in:
+5
-1
@@ -73,8 +73,12 @@ func (s *ClashService) GetClash(subId string) (*string, []string, error) {
|
||||
}
|
||||
|
||||
links := s.LinkService.GetLinks(&client.Links, "external", "")
|
||||
tagNumEnable := 0
|
||||
if len(links) > 1 {
|
||||
tagNumEnable = 1
|
||||
}
|
||||
for index, link := range links {
|
||||
json, tag, err := util.GetOutbound(link, index)
|
||||
json, tag, err := util.GetOutbound(link, (index+1)*tagNumEnable)
|
||||
if err == nil && len(tag) > 0 {
|
||||
*outbounds = append(*outbounds, *json)
|
||||
*outTags = append(*outTags, tag)
|
||||
|
||||
+5
-1
@@ -61,8 +61,12 @@ func (j *JsonService) GetJson(subId string, format string) (*string, []string, e
|
||||
}
|
||||
|
||||
links := j.LinkService.GetLinks(&client.Links, "external", "")
|
||||
tagNumEnable := 0
|
||||
if len(links) > 1 {
|
||||
tagNumEnable = 1
|
||||
}
|
||||
for index, link := range links {
|
||||
json, tag, err := util.GetOutbound(link, index)
|
||||
json, tag, err := util.GetOutbound(link, (index+1)*tagNumEnable)
|
||||
if err == nil && len(tag) > 0 {
|
||||
*outbounds = append(*outbounds, *json)
|
||||
*outTags = append(*outTags, tag)
|
||||
|
||||
Reference in New Issue
Block a user