From bbeca179d9167a1aef9ad1c0c140ea8066a6623d Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sun, 5 Mar 2023 22:48:08 +0200 Subject: [PATCH] indexers: show real publish date when build has debug set (#14128) --- src/Jackett.Common/Indexers/BaseIndexer.cs | 2 +- src/Jackett.Common/Utils/EnvironmentUtil.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Jackett.Common/Indexers/BaseIndexer.cs b/src/Jackett.Common/Indexers/BaseIndexer.cs index 7ed7c8545..ed8ac7fdc 100644 --- a/src/Jackett.Common/Indexers/BaseIndexer.cs +++ b/src/Jackett.Common/Indexers/BaseIndexer.cs @@ -196,7 +196,7 @@ namespace Jackett.Common.Indexers // fix publish date // some trackers do not keep their clocks up to date and can be ~20 minutes out! - if (r.PublishDate > DateTime.Now) + if (!EnvironmentUtil.IsDebug && r.PublishDate > DateTime.Now) r.PublishDate = DateTime.Now; // generate magnet link from info hash (not allowed for private sites) diff --git a/src/Jackett.Common/Utils/EnvironmentUtil.cs b/src/Jackett.Common/Utils/EnvironmentUtil.cs index 3f8f6f3de..9165587e2 100644 --- a/src/Jackett.Common/Utils/EnvironmentUtil.cs +++ b/src/Jackett.Common/Utils/EnvironmentUtil.cs @@ -27,5 +27,17 @@ namespace Jackett.Common.Utils public static bool IsWindows => Environment.OSVersion.Platform == PlatformID.Win32NT; + public static bool IsDebug + { + get + { +#if DEBUG + return true; +#else + return false; +#endif + } + } + } }