fix(nordvpn): remove commas from region values
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/netip"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Check out the JSON data from https://api.nordvpn.com/v2/servers?limit=10
|
||||
@@ -92,6 +93,9 @@ func (s serversData) idToData() (
|
||||
) {
|
||||
groups = make(map[uint32]groupData, len(s.Groups))
|
||||
for _, group := range s.Groups {
|
||||
if group.Type.Identifier == "regions" { //nolint:goconst
|
||||
group.Title = strings.ReplaceAll(group.Title, ",", "")
|
||||
}
|
||||
groups[group.ID] = group
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ func extractServers(jsonServer serverData, groups map[uint32]groupData,
|
||||
|
||||
server := models.Server{
|
||||
Country: location.Country.Name,
|
||||
Region: jsonServer.region(groups),
|
||||
Region: region,
|
||||
City: location.Country.City.Name,
|
||||
Categories: jsonServer.categories(groups),
|
||||
Hostname: jsonServer.Hostname,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user