Cardigann: fix missingYearRegexp handling

This commit is contained in:
kaso17 2017-01-30 15:03:23 +01:00
parent 4ea8e90d35
commit 3c33236585
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}