mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-26 22:52:40 +02:00
parent
61ee8edb5a
commit
57adf0e3a5
@ -294,12 +294,22 @@ public void FolderSetLastWriteTime(string path, DateTime dateTime)
|
||||
{
|
||||
Ensure.That(path, () => path).IsValidPath();
|
||||
|
||||
if (dateTime.Before(DateTimeExtensions.Epoch))
|
||||
{
|
||||
dateTime = DateTimeExtensions.Epoch;
|
||||
}
|
||||
|
||||
Directory.SetLastWriteTimeUtc(path, dateTime);
|
||||
}
|
||||
|
||||
public void FileSetLastWriteTime(string path, DateTime dateTime)
|
||||
{
|
||||
Ensure.That(path, () => path).IsValidPath();
|
||||
|
||||
if (dateTime.Before(DateTimeExtensions.Epoch))
|
||||
{
|
||||
dateTime = DateTimeExtensions.Epoch;
|
||||
}
|
||||
|
||||
File.SetLastWriteTime(path, dateTime);
|
||||
}
|
||||
|
@ -38,5 +38,7 @@ public static bool Between(this DateTime dateTime, DateTime afterDateTime, DateT
|
||||
{
|
||||
return dateTime >= afterDateTime && dateTime <= beforeDateTime;
|
||||
}
|
||||
|
||||
public static DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user