21 lines
602 B
C#
Raw Normal View History

using SPTInstaller.Helpers;
using System.Threading.Tasks;
namespace SPTInstaller.Models.Mirrors.Downloaders;
2024-05-01 10:31:55 -04:00
public class HttpMirrorDownloader : MirrorDownloaderBase
{
2024-04-27 14:51:54 -04:00
public HttpMirrorDownloader(PatchInfoMirror mirror) : base(mirror)
{
}
2024-05-01 10:31:55 -04:00
public override async Task<FileInfo?> Download(IProgress<double> progress)
{
var file = await DownloadCacheHelper.DownloadFileAsync("patcher", MirrorInfo.Link, progress);
2024-05-01 10:31:55 -04:00
2023-09-21 18:51:20 -04:00
if (file == null)
return null;
2024-05-01 10:31:55 -04:00
2023-09-21 18:51:20 -04:00
return FileHashHelper.CheckHash(file, MirrorInfo.Hash) ? file : null;
}
2024-05-01 10:31:55 -04:00
}