mirror of https://github.com/Jackett/Jackett
cardigann: move check for Rfc1123ZPattern (#14095)
This commit is contained in:
parent
a99093386a
commit
2a9702cad6
|
@ -2035,7 +2035,7 @@ namespace Jackett.Common.Indexers
|
||||||
value = release.Seeders.ToString();
|
value = release.Seeders.ToString();
|
||||||
break;
|
break;
|
||||||
case "date":
|
case "date":
|
||||||
release.PublishDate = DateTime.TryParseExact(value, DateTimeUtil.Rfc1123ZPattern, CultureInfo.InvariantCulture, DateTimeStyles.None, out var parsedDate) ? parsedDate : DateTimeUtil.FromUnknown(value);
|
release.PublishDate = DateTimeUtil.FromUnknown(value);
|
||||||
value = release.PublishDate.ToString(DateTimeUtil.Rfc1123ZPattern, CultureInfo.InvariantCulture);
|
value = release.PublishDate.ToString(DateTimeUtil.Rfc1123ZPattern, CultureInfo.InvariantCulture);
|
||||||
break;
|
break;
|
||||||
case "files":
|
case "files":
|
||||||
|
|
|
@ -115,6 +115,10 @@ namespace Jackett.Common.Utils
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
str = ParseUtil.NormalizeSpace(str);
|
str = ParseUtil.NormalizeSpace(str);
|
||||||
|
|
||||||
|
if (DateTime.TryParseExact(str, Rfc1123ZPattern, CultureInfo.InvariantCulture, DateTimeStyles.None, out var parsedDate))
|
||||||
|
return parsedDate;
|
||||||
|
|
||||||
var now = relativeFrom ?? DateTime.Now;
|
var now = relativeFrom ?? DateTime.Now;
|
||||||
|
|
||||||
// try parsing the str as an unix timestamp
|
// try parsing the str as an unix timestamp
|
||||||
|
|
Loading…
Reference in New Issue