check hashes in mirror downloaders
This commit is contained in:
parent
b6f883ec38
commit
174e21d03f
@ -10,6 +10,11 @@ public class HttpMirrorDownloader : MirrorDownloaderBase
|
||||
|
||||
public override async Task<FileInfo?> Download(IProgress<double> progress)
|
||||
{
|
||||
return await DownloadCacheHelper.DownloadFileAsync("patcher.zip", MirrorInfo.Link, progress);
|
||||
var file = await DownloadCacheHelper.DownloadFileAsync("patcher.zip", MirrorInfo.Link, progress);
|
||||
|
||||
if (file == null)
|
||||
return null;
|
||||
|
||||
return FileHashHelper.CheckHash(file, MirrorInfo.Hash) ? file : null;
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,12 @@ public class MegaMirrorDownloader : MirrorDownloaderBase
|
||||
{
|
||||
using var megaDownloadStream = await megaClient.DownloadAsync(new Uri(MirrorInfo.Link), progress);
|
||||
|
||||
return await DownloadCacheHelper.DownloadFileAsync("patcher.zip", megaDownloadStream);
|
||||
var file = await DownloadCacheHelper.DownloadFileAsync("patcher.zip", megaDownloadStream);
|
||||
|
||||
if (file == null)
|
||||
return null;
|
||||
|
||||
return FileHashHelper.CheckHash(file, MirrorInfo.Hash) ? file : null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user