use downladofileasync

instead of downloadasync. This seems to give better performance
This commit is contained in:
IsWaffle 2024-03-23 15:54:59 -04:00
parent defe7053d3
commit 3352ce5e31
2 changed files with 9 additions and 6 deletions

View File

@ -21,11 +21,14 @@ public class MegaMirrorDownloader : MirrorDownloaderBase
try
{
using var megaDownloadStream = await megaClient.DownloadAsync(new Uri(MirrorInfo.Link), progress);
var file = new FileInfo(Path.Join(DownloadCacheHelper.CachePath, "patcher"));
var file = await DownloadCacheHelper.DownloadFileAsync("patcher", megaDownloadStream);
await megaClient.DownloadFileAsync(new Uri(MirrorInfo.Link),
file.FullName, progress);
if (file == null)
file.Refresh();
if (!file.Exists)
return null;
return FileHashHelper.CheckHash(file, MirrorInfo.Hash) ? file : null;

View File

@ -9,8 +9,8 @@
<PackageIcon>icon.ico</PackageIcon>
<ApplicationIcon>Assets\icon.ico</ApplicationIcon>
<Configurations>Debug;Release;TEST</Configurations>
<AssemblyVersion>2.42</AssemblyVersion>
<FileVersion>2.42</FileVersion>
<AssemblyVersion>2.43</AssemblyVersion>
<FileVersion>2.43</FileVersion>
<Company>SPT-AKI</Company>
</PropertyGroup>