Fixed: Speed up parsing DateTime

This commit is contained in:
ta264 2021-12-06 21:57:22 +00:00
parent 7fcd320e23
commit 4a7bf39723

View file

@ -214,16 +214,13 @@ namespace NzbDrone.Core.Parser
return dt;
}
try
// try parsing the str as an unix timestamp
if (long.TryParse(str, out var unixTimeStamp))
{
// try parsing the str as an unix timestamp
var unixTimeStamp = long.Parse(str);
return UnixTimestampToDateTime(unixTimeStamp);
}
catch (FormatException)
{
// it wasn't a timestamp, continue....
}
// it wasn't a timestamp, continue....
// add missing year
match = _MissingYearRegexp.Match(str);