Download manual files first

This commit is contained in:
Timothy Baldridge
2019-11-06 16:59:18 -07:00
parent e518f31a71
commit 1f0591d05e

View File

@ -444,17 +444,27 @@ namespace Wabbajack.Lib
Info("Getting Nexus API Key, if a browser appears, please accept"); Info("Getting Nexus API Key, if a browser appears, please accept");
var dispatchers = ModList.Archives.Select(m => m.State.GetDownloader()).Distinct(); var dispatchers = missing.Select(m => m.State.GetDownloader()).Distinct();
foreach (var dispatcher in dispatchers) foreach (var dispatcher in dispatchers)
dispatcher.Prepare(); dispatcher.Prepare();
DownloadMissingArchives(missing); DownloadMissingArchives(missing);
} }
private void DownloadMissingArchives(List<Archive> missing, bool download = true) private void DownloadMissingArchives(List<Archive> missing, bool download = true)
{ {
missing.PMap(archive => if (download)
{
foreach (var a in missing.Where(a => a.State.GetType() == typeof(ManualDownloader.State)))
{
var output_path = Path.Combine(DownloadFolder, a.Name);
a.State.Download(a, output_path);
}
}
missing.Where(a => a.State.GetType() != typeof(ManualDownloader.State))
.PMap(archive =>
{ {
Info($"Downloading {archive.Name}"); Info($"Downloading {archive.Name}");
var output_path = Path.Combine(DownloadFolder, archive.Name); var output_path = Path.Combine(DownloadFolder, archive.Name);