update mirror list info

This commit is contained in:
IsWaffle 2024-05-18 15:18:00 -04:00
parent 84dd270f25
commit d4776b578a
2 changed files with 15 additions and 2 deletions

View File

@ -0,0 +1,8 @@
namespace EftPatchHelper.Model;
public class PatchInfo
{
public int SourceClientVersion { get; set; }
public int TargetClientVersion { get; set; }
public List<DownloadMirror> Mirrors { get; set; }
}

View File

@ -41,9 +41,14 @@ namespace EftPatchHelper.Tasks
public bool CreateMirrorList(FileInfo mirrorListFileInfo)
{
List<DownloadMirror> mirrors = _options.MirrorList.Values.ToList();
var mirrorInfo = new PatchInfo
{
SourceClientVersion = int.Parse(_options.SourceClient.Version),
TargetClientVersion = int.Parse(_options.TargetClient.Version),
Mirrors = _options.MirrorList.Values.ToList()
};
string json = JsonSerializer.Serialize(mirrors, new JsonSerializerOptions() { WriteIndented = true });
string json = JsonSerializer.Serialize(mirrorInfo, new JsonSerializerOptions() { WriteIndented = true });
File.WriteAllText(mirrorListFileInfo.FullName, json);