From e3bc606112d39715d16e20034bcf6ceee88abc2f Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Fri, 24 Jan 2014 11:27:47 -0500 Subject: [PATCH] Don't create folders for excluded files. --- DepotDownloader/ContentDownloader.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index b119320..b2867ed 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -580,9 +580,11 @@ namespace DepotDownloader ulong complete_download_size = 0; ulong size_downloaded = 0; string stagingDir = Path.Combine(depot.installDir, STAGING_DIR); + + var filesAfterExclusions = newProtoManifest.Files.AsParallel().Where(f => TestIsFileIncluded(f.FileName)).ToList(); // Pre-process - newProtoManifest.Files.ForEach(file => + filesAfterExclusions.ForEach(file => { var fileFinalPath = Path.Combine(depot.installDir, file.FileName); var fileStagingPath = Path.Combine(stagingDir, file.FileName); @@ -604,15 +606,10 @@ namespace DepotDownloader var rand = new Random(); - newProtoManifest.Files.Where(f => !f.Flags.HasFlag(EDepotFileFlag.Directory)) + filesAfterExclusions.Where(f => !f.Flags.HasFlag(EDepotFileFlag.Directory)) .AsParallel().WithDegreeOfParallelism(Config.MaxDownloads) .ForAll(file => { - if (!TestIsFileIncluded(file.FileName)) - { - return; - } - string fileFinalPath = Path.Combine(depot.installDir, file.FileName); string fileStagingPath = Path.Combine(stagingDir, file.FileName);