mirror of
https://github.com/Radarr/Radarr
synced 2025-12-14 20:33:44 +01:00
Fixed: Cleaning the French preposition 'à' from titles
This commit is contained in:
parent
8f507ac726
commit
b42f7e09f9
2 changed files with 4 additions and 2 deletions
|
|
@ -26,6 +26,8 @@ public void should_normalize_series_title(string parsedSeriesName, string series
|
|||
[TestCase("24", "24")]
|
||||
[TestCase("I'm a cyborg, but that's OK", "imcyborgbutthatsok")]
|
||||
[TestCase("Im a cyborg, but thats ok", "imcyborgbutthatsok")]
|
||||
[TestCase("Test: Something à Deux", "testsomethingdeux")]
|
||||
[TestCase("Parler à", "parlera")]
|
||||
public void should_remove_special_characters_and_casing(string dirty, string clean)
|
||||
{
|
||||
var result = dirty.CleanMovieTitle();
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ public static class Parser
|
|||
|
||||
private static readonly Regex NormalizeAlternativeTitleRegex = new Regex(@"[ ]+(?:A\.K\.A\.)[ ]+", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
private static readonly Regex NormalizeRegex = new Regex(@"((?:\b|_)(?<!^|[^a-zA-Z0-9_']\w[^a-zA-Z0-9_'])(a(?!$|[^a-zA-Z0-9_']\w[^a-zA-Z0-9_'])|an|the|and|or|of)(?!$)(?:\b|_))|\W|_",
|
||||
private static readonly Regex NormalizeRegex = new Regex(@"((?:\b|_)(?<!^|[^a-zA-Z0-9_']\w[^a-zA-Z0-9_'])([aà](?!$|[^a-zA-Z0-9_']\w[^a-zA-Z0-9_'])|an|the|and|or|of)(?!$)(?:\b|_))|\W|_",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
private static readonly Regex FileExtensionRegex = new Regex(@"\.[a-z0-9]{2,4}$",
|
||||
|
|
@ -471,7 +471,7 @@ public static string CleanMovieTitle(this string title)
|
|||
return title;
|
||||
}
|
||||
|
||||
return ReplaceGermanUmlauts(NormalizeRegex.Replace(title, string.Empty).ToLower()).RemoveAccent();
|
||||
return ReplaceGermanUmlauts(NormalizeRegex.Replace(title, string.Empty).ToLowerInvariant()).RemoveAccent();
|
||||
}
|
||||
|
||||
public static string NormalizeEpisodeTitle(this string title)
|
||||
|
|
|
|||
Loading…
Reference in a new issue