mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Merge pull request #946 from wabbajack-tools/dont-hash-while-downloading
Don't hash modlists while attempting to download them
This commit is contained in:
commit
b58ef4f3e7
@ -52,6 +52,9 @@ namespace Wabbajack
|
||||
|
||||
[Reactive]
|
||||
public bool IsBroken { get; private set; }
|
||||
|
||||
[Reactive]
|
||||
public bool IsDownloading { get; private set; }
|
||||
|
||||
[Reactive]
|
||||
public string DownloadSizeText { get; private set; }
|
||||
@ -148,7 +151,7 @@ namespace Wabbajack
|
||||
{
|
||||
try
|
||||
{
|
||||
return !(await metadata.NeedsDownload(Location));
|
||||
return !IsDownloading && !(await metadata.NeedsDownload(Location));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@ -182,9 +185,14 @@ namespace Wabbajack
|
||||
{
|
||||
try
|
||||
{
|
||||
IsDownloading = true;
|
||||
Utils.Log($"Starting Download of {Metadata.Links.MachineURL}");
|
||||
var downloader = DownloadDispatcher.ResolveArchive(Metadata.Links.Download);
|
||||
var result = await downloader.Download(new Archive(state: null!) { Name = Metadata.Title, Size = Metadata.DownloadMetadata?.Size ?? 0 }, Location);
|
||||
var result = await downloader.Download(
|
||||
new Archive(state: null!)
|
||||
{
|
||||
Name = Metadata.Title, Size = Metadata.DownloadMetadata?.Size ?? 0
|
||||
}, Location);
|
||||
Utils.Log($"Done downloading {Metadata.Links.MachineURL}");
|
||||
|
||||
// Want to rehash to current file, even if failed?
|
||||
@ -194,9 +202,13 @@ namespace Wabbajack
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.Error(ex,$"Error Downloading of {Metadata.Links.MachineURL}");
|
||||
Utils.Error(ex, $"Error Downloading of {Metadata.Links.MachineURL}");
|
||||
tcs.SetException(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsDownloading = false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user