diff --git a/Wabbajack.Common/Utils.cs b/Wabbajack.Common/Utils.cs index e400146c..62530d80 100644 --- a/Wabbajack.Common/Utils.cs +++ b/Wabbajack.Common/Utils.cs @@ -123,7 +123,7 @@ namespace Wabbajack.Common public static T Log(T msg) where T : IStatusMessage { - LogStraightToFile(msg.ExtendedDescription); + LogStraightToFile(string.IsNullOrWhiteSpace(msg.ExtendedDescription) ? msg.ShortDescription : msg.ExtendedDescription); LoggerSubj.OnNext(msg); return msg; } diff --git a/Wabbajack.VirtualFileSystem/Context.cs b/Wabbajack.VirtualFileSystem/Context.cs index 5105d83d..4ee6a82b 100644 --- a/Wabbajack.VirtualFileSystem/Context.cs +++ b/Wabbajack.VirtualFileSystem/Context.cs @@ -19,11 +19,13 @@ namespace Wabbajack.VirtualFileSystem { public class Context { + private static Task _cleanupTask; static Context() { Utils.Log("Cleaning VFS, this may take a bit of time"); - Utils.DeleteDirectory(StagingFolder).Wait(); + _cleanupTask = Utils.DeleteDirectory(StagingFolder); } + public const ulong FileVersion = 0x03; public const string Magic = "WABBAJACK VFS FILE"; @@ -54,6 +56,7 @@ namespace Wabbajack.VirtualFileSystem public async Task AddRoot(AbsolutePath root) { + await _cleanupTask; var filtered = Index.AllFiles.Where(file => file.IsNative && ((AbsolutePath) file.Name).Exists).ToList(); var byPath = filtered.ToImmutableDictionary(f => f.Name); @@ -86,6 +89,7 @@ namespace Wabbajack.VirtualFileSystem public async Task AddRoots(List roots) { + await _cleanupTask; var native = Index.AllFiles.Where(file => file.IsNative).ToDictionary(file => file.StagedPath); var filtered = Index.AllFiles.Where(file => ((AbsolutePath)file.Name).Exists).ToList(); @@ -197,6 +201,8 @@ namespace Wabbajack.VirtualFileSystem public async Task> Stage(IEnumerable files) { + await _cleanupTask; + var grouped = files.SelectMany(f => f.FilesInFullPath) .Distinct() .Where(f => f.Parent != null)