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 try
{ {
using var megaDownloadStream = await megaClient.DownloadAsync(new Uri(MirrorInfo.Link), progress); var file = new FileInfo(Path.Join(DownloadCacheHelper.CachePath, "patcher"));
await megaClient.DownloadFileAsync(new Uri(MirrorInfo.Link),
file.FullName, progress);
file.Refresh();
var file = await DownloadCacheHelper.DownloadFileAsync("patcher", megaDownloadStream); if (!file.Exists)
if (file == null)
return null; return null;
return FileHashHelper.CheckHash(file, MirrorInfo.Hash) ? file : null; return FileHashHelper.CheckHash(file, MirrorInfo.Hash) ? file : null;

View File

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