Merge pull request #283 from wabbajack-tools/fix-broken-cache-server

Consider both dates when clearing the cache
This commit is contained in:
Timothy Baldridge 2019-12-16 15:27:26 -07:00 committed by GitHub
commit 3375f807d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -430,8 +430,10 @@ namespace Wabbajack.Lib.NexusApi
parts.Contains(p.game.NexusName) && parts.Contains(p.mod.mod_id.ToString()));
if (found != null)
{
var should_remove =
File.GetLastWriteTimeUtc(f) <= found.mod.latest_file_update.AsUnixTime();
var a = found.mod.latest_file_update.AsUnixTime();
// Mod activity could hide files
var b = found.mod.latest_mod_activity.AsUnixTime();
var should_remove = File.GetLastWriteTimeUtc(f) <= (a > b ? a : b);
return (should_remove, f);
}