mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 13:10:13 -07:00
Fixed: Cleaning the French preposition 'à' from names
(cherry picked from commit 22005dc8c500cd77e4a710248582cd4a0036988f) Closes #5213
This commit is contained in:
parent
fd3f493eb6
commit
e50e79167a
2 changed files with 4 additions and 2 deletions
|
@ -24,6 +24,8 @@ namespace NzbDrone.Core.Test.ParserTests
|
||||||
[TestCase("test/test", "testtest")]
|
[TestCase("test/test", "testtest")]
|
||||||
[TestCase("90210", "90210")]
|
[TestCase("90210", "90210")]
|
||||||
[TestCase("24", "24")]
|
[TestCase("24", "24")]
|
||||||
|
[TestCase("Test: Something à Deux", "testsomethingdeux")]
|
||||||
|
[TestCase("Parler à", "parlera")]
|
||||||
public void should_remove_special_characters_and_casing(string dirty, string clean)
|
public void should_remove_special_characters_and_casing(string dirty, string clean)
|
||||||
{
|
{
|
||||||
var result = dirty.CleanArtistName();
|
var result = dirty.CleanArtistName();
|
||||||
|
|
|
@ -154,7 +154,7 @@ namespace NzbDrone.Core.Parser
|
||||||
new Regex(@"^b00bs$", RegexOptions.Compiled | RegexOptions.IgnoreCase)
|
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,
|
string.Empty,
|
||||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||||
|
|
||||||
|
@ -521,7 +521,7 @@ namespace NzbDrone.Core.Parser
|
||||||
|
|
||||||
name = PercentRegex.Replace(name, "percent");
|
name = PercentRegex.Replace(name, "percent");
|
||||||
|
|
||||||
return NormalizeRegex.Replace(name).ToLower().RemoveAccent();
|
return NormalizeRegex.Replace(name).ToLowerInvariant().RemoveAccent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string NormalizeTrackTitle(this string title)
|
public static string NormalizeTrackTitle(this string title)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue