|
|
@ -84,7 +84,7 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
if (DateTime.TryParse(fileDate + ' ' + fileTime, out var airDate))
|
|
|
|
if (DateTime.TryParse(fileDate + ' ' + fileTime, out var airDate))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// avoiding false +ve checks and set date skewing by not using UTC (Windows)
|
|
|
|
// avoiding false +ve checks and set date skewing by not using UTC (Windows)
|
|
|
|
var oldDateTime = _diskProvider.FileGetLastWrite(filePath);
|
|
|
|
var oldLastWrite = _diskProvider.FileGetLastWrite(filePath);
|
|
|
|
|
|
|
|
|
|
|
|
if (OsInfo.IsNotWindows && airDate < EpochTime)
|
|
|
|
if (OsInfo.IsNotWindows && airDate < EpochTime)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -92,12 +92,12 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
airDate = EpochTime;
|
|
|
|
airDate = EpochTime;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!DateTime.Equals(airDate, oldDateTime))
|
|
|
|
if (!DateTime.Equals(airDate.WithoutTicks(), oldLastWrite.WithoutTicks()))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_diskProvider.FileSetLastWriteTime(filePath, airDate);
|
|
|
|
_diskProvider.FileSetLastWriteTime(filePath, airDate);
|
|
|
|
_logger.Debug("Date of file [{0}] changed from '{1}' to '{2}'", filePath, oldDateTime, airDate);
|
|
|
|
_logger.Debug("Date of file [{0}] changed from '{1}' to '{2}'", filePath, oldLastWrite, airDate);
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -125,11 +125,11 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
airDateUtc = EpochTime;
|
|
|
|
airDateUtc = EpochTime;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!DateTime.Equals(airDateUtc, oldLastWrite))
|
|
|
|
if (!DateTime.Equals(airDateUtc.WithoutTicks(), oldLastWrite.WithoutTicks()))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_diskProvider.FileSetLastWriteTime(filePath, airDateUtc);
|
|
|
|
_diskProvider.FileSetLastWriteTime(filePath, airDateUtc.AddMilliseconds(oldLastWrite.Millisecond));
|
|
|
|
_logger.Debug("Date of file [{0}] changed from '{1}' to '{2}'", filePath, oldLastWrite, airDateUtc);
|
|
|
|
_logger.Debug("Date of file [{0}] changed from '{1}' to '{2}'", filePath, oldLastWrite, airDateUtc);
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|