From 6e1bef13e2d24c46babafcd75d27cd17be4c19f6 Mon Sep 17 00:00:00 2001 From: Qstick Date: Mon, 2 Jan 2023 23:28:36 -0600 Subject: [PATCH] Fixed: Correctly calculate UI age for some indexers --- src/NzbDrone.Core/Indexers/Definitions/Nebulance.cs | 2 +- src/NzbDrone.Core/Parser/DateTimeUtil.cs | 2 +- src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/Nebulance.cs b/src/NzbDrone.Core/Indexers/Definitions/Nebulance.cs index 3549a9e10..d28e772f7 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Nebulance.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Nebulance.cs @@ -208,7 +208,7 @@ public IList ParseResponse(IndexerResponse indexerResponse) Categories = new List { TvCategoryFromQualityParser.ParseTvShowQuality(row.ReleaseTitle) }, Size = ParseUtil.CoerceLong(row.Size), Files = row.FileList.Length, - PublishDate = DateTime.Parse(row.PublishDateUtc, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal), + PublishDate = DateTime.Parse(row.PublishDateUtc, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal), Grabs = ParseUtil.CoerceInt(row.Snatch), Seeders = ParseUtil.CoerceInt(row.Seed), Peers = ParseUtil.CoerceInt(row.Seed) + ParseUtil.CoerceInt(row.Leech), diff --git a/src/NzbDrone.Core/Parser/DateTimeUtil.cs b/src/NzbDrone.Core/Parser/DateTimeUtil.cs index 1c1278645..3e05f60a7 100644 --- a/src/NzbDrone.Core/Parser/DateTimeUtil.cs +++ b/src/NzbDrone.Core/Parser/DateTimeUtil.cs @@ -109,7 +109,7 @@ public static DateTime FromFuzzyTime(string str, string format = null) if (DateTimeRoutines.TryParseDateOrTime( str, dtFormat, out DateTimeRoutines.ParsedDateTime dt)) { - return dt.DateTime.ToUniversalTime(); + return dt.DateTime; } throw new InvalidDateException($"FromFuzzyTime parsing failed for string {str}"); diff --git a/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs b/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs index 511f4f683..bcea24de5 100644 --- a/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs +++ b/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs @@ -61,7 +61,7 @@ public ReleaseInfo() public int Age { - get { return DateTime.UtcNow.Subtract(PublishDate).Days; } + get { return DateTime.UtcNow.Subtract(PublishDate.ToUniversalTime()).Days; } //This prevents manually downloading a release from blowing up in mono //TODO: Is there a better way? @@ -70,7 +70,7 @@ private set { } public double AgeHours { - get { return DateTime.UtcNow.Subtract(PublishDate).TotalHours; } + get { return DateTime.UtcNow.Subtract(PublishDate.ToUniversalTime()).TotalHours; } //This prevents manually downloading a release from blowing up in mono //TODO: Is there a better way? @@ -79,7 +79,7 @@ private set { } public double AgeMinutes { - get { return DateTime.UtcNow.Subtract(PublishDate).TotalMinutes; } + get { return DateTime.UtcNow.Subtract(PublishDate.ToUniversalTime()).TotalMinutes; } //This prevents manually downloading a release from blowing up in mono //TODO: Is there a better way?