From a4254af3c9c81a97d4fd9a43529cfd355182d8eb Mon Sep 17 00:00:00 2001 From: Unnoen Date: Fri, 7 Aug 2020 18:29:12 +1000 Subject: [PATCH] Utilize hash cache on install. --- Wabbajack.Common/Hash.cs | 4 ++++ Wabbajack.Lib/AInstaller.cs | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Wabbajack.Common/Hash.cs b/Wabbajack.Common/Hash.cs index 73900dc7..8935b56e 100644 --- a/Wabbajack.Common/Hash.cs +++ b/Wabbajack.Common/Hash.cs @@ -202,6 +202,10 @@ namespace Wabbajack.Common bw.Write((ulong)hash); _hashCache.Put(Encoding.UTF8.GetBytes(file.Normalize()), ms.ToArray()); } + public static void FileHashWriteCache(this AbsolutePath file, Hash hash) + { + WriteHashCache(file, hash); + } public static async Task FileHashCachedAsync(this AbsolutePath file, bool nullOnIOError = false) { diff --git a/Wabbajack.Lib/AInstaller.cs b/Wabbajack.Lib/AInstaller.cs index 2c5b2a5a..7f7b417b 100644 --- a/Wabbajack.Lib/AInstaller.cs +++ b/Wabbajack.Lib/AInstaller.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.IO.Compression; @@ -228,6 +228,11 @@ namespace Wabbajack.Lib } } + foreach (var file in group) + { + file.To.RelativeTo(OutputFolder).FileHashWriteCache(file.Hash); + } + if (UseCompression) { foreach (var file in group)