Skip to content

Commit 050ab24

Browse files
committed
add minimum date to auto-upload files
1 parent 42b4561 commit 050ab24

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Gui/Models/ObjectEditorModel.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,13 @@ public async Task UploadDatToServer(ObjectIndexEntry dat)
372372
return;
373373
}
374374

375+
var minimumDate = new DateTime(2024, 01, 01);
376+
if (File.GetCreationTimeUtc(filename) > minimumDate || File.GetLastWriteTimeUtc(filename) > minimumDate)
377+
{
378+
Logger.Debug("File is really new - skipping automatic upload for now as this doens't seem like an historical dat file");
379+
return;
380+
}
381+
375382
await Client.UploadDatFileAsync(WebClient, dat.Filename, await File.ReadAllBytesAsync(filename), lastModifiedTime, Logger);
376383
await Task.Delay(100); // wait 100ms, ie don't DoS the server
377384
}

0 commit comments

Comments
 (0)