Skip to content

Commit

Permalink
Code clean
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Nov 2, 2024
1 parent 3a2c9e7 commit 046421f
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions v2rayN/ServiceLib/Services/UpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ namespace ServiceLib.Services
public class UpdateService
{
private Action<bool, string>? _updateFunc;
private Config _config;
private int _timeout = 30;

public async Task CheckUpdateGuiN(Config config, Action<bool, string> updateFunc, bool preRelease)
{
_config = config;
_updateFunc = updateFunc;
var url = string.Empty;
var fileName = string.Empty;
Expand Down Expand Up @@ -53,7 +51,6 @@ public async Task CheckUpdateGuiN(Config config, Action<bool, string> updateFunc

public async Task CheckUpdateCore(ECoreType type, Config config, Action<bool, string> updateFunc, bool preRelease)
{
_config = config;
_updateFunc = updateFunc;
var url = string.Empty;
var fileName = string.Empty;
Expand Down Expand Up @@ -108,7 +105,6 @@ public async Task CheckUpdateCore(ECoreType type, Config config, Action<bool, st

public async Task UpdateSubscriptionProcess(Config config, string subId, bool blProxy, Action<bool, string> updateFunc)
{
_config = config;
_updateFunc = updateFunc;

_updateFunc?.Invoke(false, ResUI.MsgUpdateSubscriptionStart);
Expand Down Expand Up @@ -454,7 +450,6 @@ private async Task<RetResult> ParseDownloadUrl(ECoreType type, SemanticVersion v

private async Task UpdateGeoFile(string geoName, Config config, Action<bool, string> updateFunc)
{
_config = config;
_updateFunc = updateFunc;

var geoUrl = string.IsNullOrEmpty(config?.ConstItem.GeoSourceUrl)
Expand All @@ -470,7 +465,6 @@ private async Task UpdateGeoFile(string geoName, Config config, Action<bool, str

private async Task UpdateSrsFileAll(Config config, Action<bool, string> updateFunc)
{
_config = config;
_updateFunc = updateFunc;

var geoipFiles = new List<string>();
Expand Down Expand Up @@ -521,9 +515,9 @@ private async Task UpdateSrsFileAll(Config config, Action<bool, string> updateFu

private async Task UpdateSrsFile(string type, string srsName, Config config, Action<bool, string> updateFunc)
{
var srsUrl = string.IsNullOrEmpty(_config.ConstItem.SrsSourceUrl)
var srsUrl = string.IsNullOrEmpty(config.ConstItem.SrsSourceUrl)
? Global.SingboxRulesetUrl
: _config.ConstItem.SrsSourceUrl;
: config.ConstItem.SrsSourceUrl;

var fileName = $"{type}-{srsName}.srs";
var targetPath = Path.Combine(Utils.GetBinPath("srss"), fileName);
Expand Down

0 comments on commit 046421f

Please sign in to comment.