mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fixes for sql for unicode paths in sql tables (instead of ascitables 🤦)
This commit is contained in:
parent
1b428cd03b
commit
4377f430f3
@ -18,18 +18,20 @@ namespace Wabbajack.BuildServer.Models.Jobs
|
||||
{
|
||||
using (var queue = new WorkQueue())
|
||||
{
|
||||
var total_count = Directory.EnumerateFiles(settings.ArchiveDir).Count();
|
||||
var files = Directory.EnumerateFiles(settings.ArchiveDir)
|
||||
.Where(f => !f.EndsWith(Consts.HashFileExtension))
|
||||
.ToList();
|
||||
var total_count = files.Count;
|
||||
int completed = 0;
|
||||
|
||||
|
||||
await Directory.EnumerateFiles(settings.ArchiveDir)
|
||||
.PMap(queue, async file =>
|
||||
await files.PMap(queue, async file =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Interlocked.Increment(ref completed);
|
||||
|
||||
if (await sql.HaveIndexdFile(await file.FileHashAsync()))
|
||||
if (await sql.HaveIndexdFile(await file.FileHashCachedAsync()))
|
||||
{
|
||||
Utils.Log($"({completed}/{total_count}) Skipping {Path.GetFileName(file)}, it's already indexed");
|
||||
return;
|
||||
|
Binary file not shown.
@ -215,6 +215,19 @@ namespace Wabbajack.Common
|
||||
File.WriteAllText(hashPath, hash);
|
||||
return hash;
|
||||
}
|
||||
|
||||
public static async Task<string> FileHashCachedAsync(this string file, bool nullOnIOError = false)
|
||||
{
|
||||
var hashPath = file + Consts.HashFileExtension;
|
||||
if (File.Exists(hashPath) && File.GetLastWriteTime(file) <= File.GetLastWriteTime(hashPath))
|
||||
{
|
||||
return File.ReadAllText(hashPath);
|
||||
}
|
||||
|
||||
var hash = await file.FileHashAsync(nullOnIOError);
|
||||
File.WriteAllText(hashPath, hash);
|
||||
return hash;
|
||||
}
|
||||
|
||||
public static async Task<string> FileHashAsync(this string file, bool nullOnIOError = false)
|
||||
{
|
||||
|
@ -62,6 +62,7 @@ namespace Wabbajack.Test
|
||||
});
|
||||
|
||||
await DownloadAndInstall(Game.SkyrimSpecialEdition, 12604, "SkyUI");
|
||||
await DownloadAndInstall(Game.Fallout4, 11925, "Anti-Tank Rifle");
|
||||
|
||||
utils.Configure();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user