Fix file extraction progress bars not displaying properly (and going away)

This commit is contained in:
Timothy Baldridge 2022-09-25 17:07:54 -06:00
parent cc329bd04c
commit 431b00fa50
3 changed files with 11 additions and 6 deletions

View File

@ -8,6 +8,7 @@
* Massively improve patch load times
* Massively improve patch build times
* Reduce situations where the UI appears to be hung due the above two issues
* Fix file extraction progress bars not displaying properly (and going away)
#### Version - 3.0.1.4 - 9/21/2022

View File

@ -473,13 +473,18 @@ public abstract class ACompiler
NextStep("Compiling", "Generating Patches", toBuild.Length);
var allFiles = toBuild.SelectMany(f => new[]
var allFiles = toBuild.SelectMany(f =>
{
UpdateProgress(1);
return new[]
{
_vfs.Index.FileForArchiveHashPath(f.ArchiveHashPath),
FindDestFile(f.To)
};
})
.DistinctBy(f => f.Hash)
.ToHashSet();
_logger.LogInformation("Extracting {Count} ({Size}) files for building patches", allFiles.Count,
allFiles.Sum(f => f.Size).ToFileSizeString());

View File

@ -13,7 +13,6 @@ using OMODFramework;
using Wabbajack.Common;
using Wabbajack.Common.FileSignatures;
using Wabbajack.Compression.BSA;
using Wabbajack.Compression.BSA.FO4Archive;
using Wabbajack.DTOs.Streams;
using Wabbajack.FileExtractor.ExtractedFiles;
using Wabbajack.IO.Async;
@ -343,8 +342,8 @@ public class FileExtractor
if (!int.TryParse(line[..3], out var percentInt)) return;
var oldPosition = lastPercent == 0 ? 0 : totalSize / lastPercent;
var newPosition = percentInt == 0 ? 0 : totalSize / percentInt;
var oldPosition = lastPercent == 0 ? 0 : totalSize / 100 * lastPercent;
var newPosition = percentInt == 0 ? 0 : totalSize / 100 * percentInt;
var throughput = newPosition - oldPosition;
job.ReportNoWait((int) throughput);