Fixed: Correctly calculate UI age for some indexers

This commit is contained in:
Qstick
2023-01-02 23:28:36 -06:00
parent 72ee413411
commit 6e1bef13e2
3 changed files with 5 additions and 5 deletions

View File

@@ -208,7 +208,7 @@ namespace NzbDrone.Core.Indexers.Definitions
Categories = new List<IndexerCategory> { TvCategoryFromQualityParser.ParseTvShowQuality(row.ReleaseTitle) }, Categories = new List<IndexerCategory> { TvCategoryFromQualityParser.ParseTvShowQuality(row.ReleaseTitle) },
Size = ParseUtil.CoerceLong(row.Size), Size = ParseUtil.CoerceLong(row.Size),
Files = row.FileList.Length, 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), Grabs = ParseUtil.CoerceInt(row.Snatch),
Seeders = ParseUtil.CoerceInt(row.Seed), Seeders = ParseUtil.CoerceInt(row.Seed),
Peers = ParseUtil.CoerceInt(row.Seed) + ParseUtil.CoerceInt(row.Leech), Peers = ParseUtil.CoerceInt(row.Seed) + ParseUtil.CoerceInt(row.Leech),

View File

@@ -109,7 +109,7 @@ namespace NzbDrone.Core.Parser
if (DateTimeRoutines.TryParseDateOrTime( if (DateTimeRoutines.TryParseDateOrTime(
str, dtFormat, out DateTimeRoutines.ParsedDateTime dt)) str, dtFormat, out DateTimeRoutines.ParsedDateTime dt))
{ {
return dt.DateTime.ToUniversalTime(); return dt.DateTime;
} }
throw new InvalidDateException($"FromFuzzyTime parsing failed for string {str}"); throw new InvalidDateException($"FromFuzzyTime parsing failed for string {str}");

View File

@@ -61,7 +61,7 @@ namespace NzbDrone.Core.Parser.Model
public int Age 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 //This prevents manually downloading a release from blowing up in mono
//TODO: Is there a better way? //TODO: Is there a better way?
@@ -70,7 +70,7 @@ namespace NzbDrone.Core.Parser.Model
public double AgeHours 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 //This prevents manually downloading a release from blowing up in mono
//TODO: Is there a better way? //TODO: Is there a better way?
@@ -79,7 +79,7 @@ namespace NzbDrone.Core.Parser.Model
public double AgeMinutes 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 //This prevents manually downloading a release from blowing up in mono
//TODO: Is there a better way? //TODO: Is there a better way?