Merge pull request #290 from wabbajack-tools/fix-redownload-on-update

UI wasn't prompting for a new download when the list was updated
This commit is contained in:
Timothy Baldridge 2019-12-17 22:25:21 -07:00 committed by GitHub
commit 1b2c4925a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -150,7 +150,7 @@ namespace Wabbajack.Common
}
}
public static string FileHashCached(this string file)
public static string FileHashCached(this string file, bool nullOnIOError = false)
{
var hashPath = file + Consts.HashFileExtension;
if (File.Exists(hashPath) && File.GetLastWriteTime(file) <= File.GetLastWriteTime(hashPath))
@ -158,7 +158,7 @@ namespace Wabbajack.Common
return File.ReadAllText(hashPath);
}
var hash = file.FileHash();
var hash = file.FileHash(nullOnIOError);
File.WriteAllText(hashPath, hash);
return hash;
}

View File

@ -91,7 +91,7 @@ namespace Wabbajack.Lib.ModListRegistry
{
return true;
}
return DownloadMetadata.Hash != modlistPath.FileHashCached();
return DownloadMetadata.Hash != modlistPath.FileHashCached(true);
}
}

View File

@ -76,7 +76,7 @@ namespace Wabbajack
_Exists = Observable.Interval(TimeSpan.FromSeconds(0.5))
.Unit()
.StartWith(Unit.Default)
.Select(_ => File.Exists(Location))
.Select(_ => !metadata.NeedsDownload(Location))
.ToProperty(this, nameof(Exists));
}