mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Merge pull request #469 from wabbajack-tools/finis-nemisis-errors
Fixes for sql for unicode paths in sql tables (instead of ascitables …
This commit is contained in:
commit
d983bcc168
@ -18,18 +18,20 @@ namespace Wabbajack.BuildServer.Models.Jobs
|
|||||||
{
|
{
|
||||||
using (var queue = new WorkQueue())
|
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;
|
int completed = 0;
|
||||||
|
|
||||||
|
|
||||||
await Directory.EnumerateFiles(settings.ArchiveDir)
|
await files.PMap(queue, async file =>
|
||||||
.PMap(queue, async file =>
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Interlocked.Increment(ref completed);
|
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");
|
Utils.Log($"({completed}/{total_count}) Skipping {Path.GetFileName(file)}, it's already indexed");
|
||||||
return;
|
return;
|
||||||
|
Binary file not shown.
@ -215,6 +215,19 @@ namespace Wabbajack.Common
|
|||||||
File.WriteAllText(hashPath, hash);
|
File.WriteAllText(hashPath, hash);
|
||||||
return 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)
|
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.SkyrimSpecialEdition, 12604, "SkyUI");
|
||||||
|
await DownloadAndInstall(Game.Fallout4, 11925, "Anti-Tank Rifle");
|
||||||
|
|
||||||
utils.Configure();
|
utils.Configure();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user