diff --git a/src/Jackett/Utils/DateTimeUtil.cs b/src/Jackett/Utils/DateTimeUtil.cs index 49dcd00f0..af2324f9a 100644 --- a/src/Jackett/Utils/DateTimeUtil.cs +++ b/src/Jackett/Utils/DateTimeUtil.cs @@ -85,6 +85,9 @@ namespace Jackett.Utils public static TimeSpan ParseTimeSpan(string time) { + if (string.IsNullOrWhiteSpace(time)) + return TimeSpan.Zero; + TimeSpan offset = TimeSpan.Zero; if (time.EndsWith("AM")) { @@ -122,9 +125,9 @@ namespace Jackett.Utils } public static Regex timeAgoRegexp = new Regex(@"(?i)\bago", RegexOptions.Compiled); - public static Regex todayRegexp = new Regex(@"(?i)\btoday([\s,]+|$)", RegexOptions.Compiled); - public static Regex tomorrowRegexp = new Regex(@"(?i)\btomorrow([\s,]+|$)", RegexOptions.Compiled); - public static Regex yesterdayRegexp = new Regex(@"(?i)\byesterday([\s,]+|$)", RegexOptions.Compiled); + public static Regex todayRegexp = new Regex(@"(?i)\btoday([\s,]*|$)", RegexOptions.Compiled); + public static Regex tomorrowRegexp = new Regex(@"(?i)\btomorrow([\s,]*|$)", RegexOptions.Compiled); + public static Regex yesterdayRegexp = new Regex(@"(?i)\byesterday([\s,]*|$)", RegexOptions.Compiled); public static Regex missingYearRegexp = new Regex(@"^\d{1,2}-\d{1,2}\b", RegexOptions.Compiled); public static Regex missingYearRegexp2 = new Regex(@"^(\d{1,2}\s+\w{3})\s+(\d{1,2}\:\d{1,2}.*)$", RegexOptions.Compiled); // 1 Jan 10:30