mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2025-07-25 04:43:58 +00:00
Fix timeouts caused by having too many patches
This commit is contained in:
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Alphaleonis.Win32.Filesystem;
|
using Alphaleonis.Win32.Filesystem;
|
||||||
|
using F23.StringSimilarity;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Wabbajack.Common;
|
using Wabbajack.Common;
|
||||||
using Wabbajack.VirtualFileSystem;
|
using Wabbajack.VirtualFileSystem;
|
||||||
@ -75,8 +76,11 @@ namespace Wabbajack.Lib.CompilationSteps
|
|||||||
var relName = (RelativePath)Path.GetFileName(matchAllName);
|
var relName = (RelativePath)Path.GetFileName(matchAllName);
|
||||||
if (_indexedByName.TryGetValue(relName, out var arch))
|
if (_indexedByName.TryGetValue(relName, out var arch))
|
||||||
{
|
{
|
||||||
// Just match some file in the archive based on the smallest delta difference
|
var dist = new Levenshtein();
|
||||||
found = arch.SelectMany(a => a.ThisAndAllChildren).ToArray();
|
found = arch.SelectMany(a => a.ThisAndAllChildren)
|
||||||
|
.OrderBy(a => dist.Distance(a.FullPath.FileName.ToString(), source.File.FullPath.FileName.ToString()))
|
||||||
|
.Take(3)
|
||||||
|
.ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user