21 lines
581 B
C#
Raw Permalink Normal View History

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