Fixed: Cleaning the French preposition 'à' from names

(cherry picked from commit 22005dc8c500cd77e4a710248582cd4a0036988f)

Closes #5213
pull/1829/head
Bogdan 3 weeks ago
parent fd3f493eb6
commit e50e79167a

@ -24,6 +24,8 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("test/test", "testtest")]
[TestCase("90210", "90210")]
[TestCase("24", "24")]
[TestCase("Test: Something à Deux", "testsomethingdeux")]
[TestCase("Parler à", "parlera")]
public void should_remove_special_characters_and_casing(string dirty, string clean)
{
var result = dirty.CleanArtistName();

@ -154,7 +154,7 @@ namespace NzbDrone.Core.Parser
new Regex(@"^b00bs$", RegexOptions.Compiled | RegexOptions.IgnoreCase)
};
private static readonly RegexReplace NormalizeRegex = new RegexReplace(@"((?:\b|_)(?<!^)(a(?!$)|an|the|and|or|of)(?!$)(?:\b|_))|\W|_",
private static readonly RegexReplace NormalizeRegex = new RegexReplace(@"((?:\b|_)(?<!^)([aà](?!$)|an|the|and|or|of)(?!$)(?:\b|_))|\W|_",
string.Empty,
RegexOptions.IgnoreCase | RegexOptions.Compiled);
@ -521,7 +521,7 @@ namespace NzbDrone.Core.Parser
name = PercentRegex.Replace(name, "percent");
return NormalizeRegex.Replace(name).ToLower().RemoveAccent();
return NormalizeRegex.Replace(name).ToLowerInvariant().RemoveAccent();
}
public static string NormalizeTrackTitle(this string title)

Loading…
Cancel
Save