Browse Source

escape comma for csv;

prevent a bug
tags/3.0
icylogic 9 years ago
parent
commit
6550c04650
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      shadowsocks-csharp/Controller/Service/AvailabilityStatistics.cs

+ 4
- 3
shadowsocks-csharp/Controller/Service/AvailabilityStatistics.cs View File

@@ -83,7 +83,7 @@ namespace Shadowsocks.Controller
{ {
Logging.Debug("Retrive information of geolocation and isp"); Logging.Debug("Retrive information of geolocation and isp");
const string API = "http://ip-api.com/json"; const string API = "http://ip-api.com/json";
const string alternativeAPI = "http://www.telize.com/geoip"; //must be compatible with current API
const string alternativeAPI = "http://www.telize.com/geoip"; //must be comptible with current API
var result = await GetInfoFromAPI(API); var result = await GetInfoFromAPI(API);
if (result != null) return result; if (result != null) return result;
result = await GetInfoFromAPI(alternativeAPI); result = await GetInfoFromAPI(alternativeAPI);
@@ -114,8 +114,8 @@ namespace Shadowsocks.Controller
string isp = obj["isp"]; string isp = obj["isp"];
if (country == null || city == null || isp == null) return null; if (country == null || city == null || isp == null) return null;
return new DataList { return new DataList {
new DataUnit(State.Geolocation, $"{country} {city}"),
new DataUnit(State.ISP, isp)
new DataUnit(State.Geolocation, $"\"{country} {city}\""),
new DataUnit(State.ISP, $"\"{isp}\"")
}; };
} }


@@ -206,6 +206,7 @@ namespace Shadowsocks.Controller


private async void FilterRawStatistics() private async void FilterRawStatistics()
{ {
if (RawStatistics == null) return;
if (FilteredStatistics == null) if (FilteredStatistics == null)
{ {
FilteredStatistics = new Statistics(); FilteredStatistics = new Statistics();


Loading…
Cancel
Save