mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Merge pull request #1249 from Unnoen/filter-size-before-hash
Filter downloads for file size before hashing archives.
This commit is contained in:
commit
2ce0484680
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
@ -279,11 +279,16 @@ namespace Wabbajack.Lib
|
||||
public async Task HashArchives()
|
||||
{
|
||||
Utils.Log("Looking for files to hash");
|
||||
var toHash = DownloadFolder.EnumerateFiles()
|
||||
|
||||
var allFiles = DownloadFolder.EnumerateFiles()
|
||||
.Concat(Game.GameLocation().EnumerateFiles())
|
||||
.ToList();
|
||||
|
||||
var hashDict = allFiles.GroupBy(f => f.Size).ToDictionary(g => g.Key);
|
||||
|
||||
var toHash = ModList.Archives.Where(a => hashDict.ContainsKey(a.Size)).SelectMany(a => hashDict[a.Size]).ToList();
|
||||
|
||||
Utils.Log($"Found {toHash.Count} files to hash");
|
||||
Utils.Log($"Found {allFiles.Count} total files, {toHash.Count} matching filesize");
|
||||
|
||||
var hashResults = await
|
||||
toHash
|
||||
|
Loading…
Reference in New Issue
Block a user