Custom geo file source from settings (#5829)

Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com>
This commit is contained in:
runetfreedom
2024-10-14 12:50:44 +03:00
committed by GitHub
parent 2698137dea
commit c6caf29b5b
10 changed files with 72 additions and 4 deletions
+4 -2
View File
@@ -255,8 +255,8 @@ namespace ServiceLib.Services
public async Task UpdateGeoFileAll(Config config, Action<bool, string> updateFunc)
{
await UpdateGeoFile("geosite", _config, updateFunc);
await UpdateGeoFile("geoip", _config, updateFunc);
await UpdateGeoFile("geosite", config, updateFunc);
await UpdateGeoFile("geoip", config, updateFunc);
_updateFunc?.Invoke(true, string.Format(ResUI.MsgDownloadGeoFileSuccessfully, "geo"));
}
@@ -450,6 +450,8 @@ namespace ServiceLib.Services
{
_config = config;
_updateFunc = updateFunc;
var geoUrl = !String.IsNullOrEmpty(config?.guiItem.geoSourceUrl) ? config.guiItem.geoSourceUrl : Global.GeoUrl;
var url = string.Format(Global.GeoUrl, geoName);
var fileName = Utils.GetTempPath(Utils.GetGuid());