1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-27 18:30:45 +00:00

Fixed: No not trim trailing "A" from series title when looking for a matching series

This commit is contained in:
Mark McDowall 2015-01-11 10:23:47 -08:00
parent 8aa523c6df
commit fc0fa2c22f
3 changed files with 7 additions and 2 deletions

View file

@ -66,7 +66,6 @@ public void Setup()
[TestCase("backslash \\ backlash", "backslash backlash")]
[TestCase("I'm the Boss", "Im the Boss")]
//[TestCase("", "")]
//[TestCase("", "")]
public void should_get_expected_title_back(string title, string expected)
{
_series.Title = title;

View file

@ -113,5 +113,11 @@ public void should_not_clean_word_from_beginning_of_string(string word)
dirty.CleanSeriesTitle().Should().Be(word + "wordword");
}
}
[Test]
public void should_not_clean_trailing_a()
{
"Tokyo Ghoul A".CleanSeriesTitle().Should().Be("tokyoghoula");
}
}
}

View file

@ -147,7 +147,7 @@ public static class Parser
//Regex to detect whether the title was reversed.
private static readonly Regex ReversedTitleRegex = new Regex(@"[-._ ](p027|p0801|\d{2}E\d{2}S)[-._ ]", RegexOptions.Compiled);
private static readonly Regex NormalizeRegex = new Regex(@"((?:\b|_)(?<!^)(a|an|the|and|or|of)(?:\b|_))|\W|_",
private static readonly Regex NormalizeRegex = new Regex(@"((?:\b|_)(?<!^)(a(?!$)|an|the|and|or|of)(?:\b|_))|\W|_",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex FileExtensionRegex = new Regex(@"\.[a-z0-9]{2,4}$",