transmitthenet (nebulance): handle both date settings, #5496

This commit is contained in:
Garfield69 2019-06-18 10:05:49 +12:00
parent 1a548d1c8c
commit d4e776e23a
1 changed files with 4 additions and 1 deletions

View File

@ -137,7 +137,10 @@ namespace Jackett.Common.Indexers
release.Category = new List<int> { TvCategoryParser.ParseTvShowQuality(release.Title) }; release.Category = new List<int> { TvCategoryParser.ParseTvShowQuality(release.Title) };
var timeAnchor = row.QuerySelector("span[class='time']"); var timeAnchor = row.QuerySelector("span[class='time']");
release.PublishDate = DateTime.ParseExact(timeAnchor.TextContent.Trim(), "MMM dd yyyy, HH:mm", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal); var publishdate = timeAnchor.GetAttribute("title");
release.PublishDate = !string.IsNullOrEmpty(publishdate) && publishdate.Contains(",")
? DateTime.ParseExact(publishdate, "MMM dd yyyy, HH:mm", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal)
: DateTime.ParseExact(timeAnchor.TextContent.Trim(), "MMM dd yyyy, HH:mm", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal);
release.Seeders = ParseUtil.CoerceInt(timeAnchor.ParentElement.NextElementSibling.NextElementSibling.TextContent.Trim()); release.Seeders = ParseUtil.CoerceInt(timeAnchor.ParentElement.NextElementSibling.NextElementSibling.TextContent.Trim());
release.Peers = ParseUtil.CoerceInt(timeAnchor.ParentElement.NextElementSibling.NextElementSibling.NextElementSibling.TextContent.Trim()) + release.Seeders; release.Peers = ParseUtil.CoerceInt(timeAnchor.ParentElement.NextElementSibling.NextElementSibling.NextElementSibling.TextContent.Trim()) + release.Seeders;
release.Size = ReleaseInfo.GetBytes(timeAnchor.ParentElement.PreviousElementSibling.TextContent); release.Size = ReleaseInfo.GetBytes(timeAnchor.ParentElement.PreviousElementSibling.TextContent);