From 3c33236585dcfe7ce0d9ad2f1d90efad039953df Mon Sep 17 00:00:00 2001 From: kaso17 Date: Mon, 30 Jan 2017 15:03:23 +0100 Subject: [PATCH] Cardigann: fix missingYearRegexp handling --- src/Jackett/Utils/DateTimeUtil.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Jackett/Utils/DateTimeUtil.cs b/src/Jackett/Utils/DateTimeUtil.cs index 2c6433c95..f0a0d6dda 100644 --- a/src/Jackett/Utils/DateTimeUtil.cs +++ b/src/Jackett/Utils/DateTimeUtil.cs @@ -128,7 +128,7 @@ namespace Jackett.Utils 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}(\s|$)", RegexOptions.Compiled); + public static Regex missingYearRegexp = new Regex(@"^(\d{1,2}-\d{1,2})(\s|$)", 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 public static DateTime FromUnknown(string str, string format = null) @@ -197,8 +197,8 @@ namespace Jackett.Utils match = missingYearRegexp.Match(str); if (match.Success) { - var date = match.Groups[0].Value; - string newDate = date+"-"+DateTime.Now.Year.ToString(); + var date = match.Groups[1].Value; + string newDate = DateTime.Now.Year.ToString()+ "-"+date; str = str.Replace(date, newDate); }