Add back file random dating (and test runner)
Some checks failed
Release / tag-and-release (push) Has been cancelled

This commit is contained in:
2025-09-12 14:52:07 +01:00
parent 14ee5fe6ce
commit e52fb6a452
2 changed files with 13 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
<Project Sdk="Dalamud.NET.Sdk/13.1.0">
<PropertyGroup>
<AssemblyName>ClubPenguinSync</AssemblyName>
<Version>1.7.1.0</Version>
<Version>1.7.1.1</Version>
<PackageProjectUrl>https://github.com/Rawrington/ClubPenguinSync/</PackageProjectUrl>
</PropertyGroup>

View File

@@ -425,6 +425,18 @@ public partial class FileDownloadManager : DisposableMediatorSubscriberBase
private void PersistFileToStorage(string fileHash, string filePath, long? compressedSize = null)
{
var fi = new FileInfo(filePath);
Func<DateTime> RandomDayInThePast()
{
DateTime start = new(1995, 1, 1, 1, 1, 1, DateTimeKind.Local);
Random gen = new();
int range = (DateTime.Today - start).Days;
return () => start.AddDays(gen.Next(range));
}
fi.CreationTime = RandomDayInThePast().Invoke();
fi.LastAccessTime = DateTime.Today;
fi.LastWriteTime = RandomDayInThePast().Invoke();
try
{
var entry = _fileDbManager.CreateCacheEntry(filePath, fileHash);