Merge pull request 'use downladofileasync' (#58) from waffle.lord/SPT-AKI-Installer:fix/mega-download into master
Reviewed-on: CWX/SPT-AKI-Installer#58
This commit is contained in:
commit
c7b6c2e606
@ -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;
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user