Fixed: Remove apostrophe, backtick in contractions

(cherry picked from commit 6a4824c02932ee1bd57c1f4f0644f8bc693f6006)

Closes #10178
pull/9499/merge
diamondpete 4 months ago committed by Bogdan
parent ae89ae175f
commit d503e01747

@ -62,6 +62,14 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
[TestCase("[a] title", "a title")] [TestCase("[a] title", "a title")]
[TestCase("backslash \\ backlash", "backslash backlash")] [TestCase("backslash \\ backlash", "backslash backlash")]
[TestCase("I'm the Boss", "Im the Boss")] [TestCase("I'm the Boss", "Im the Boss")]
[TestCase("I've Been Caught", "Ive Been Caught")]
[TestCase("I'm Lost", "Im Lost")]
[TestCase("That'll Be The Day", "Thatll Be The Day")]
[TestCase("I'd Rather Be Alone", "Id Rather Be Alone")]
[TestCase("I Can't Die", "I Cant Die")]
[TestCase("Won`t Get Fooled Again", "Wont Get Fooled Again")]
[TestCase("Dont Blink", "Dont Blink")]
[TestCase("The ` Legend of Kings", "The Legend of Kings")]
// [TestCase("", "")] // [TestCase("", "")]
public void should_get_expected_title_back(string title, string expected) public void should_get_expected_title_back(string title, string expected)

@ -48,7 +48,7 @@ namespace NzbDrone.Core.Organizer
private static readonly Regex FileNameCleanupRegex = new Regex(@"([- ._])(\1)+", RegexOptions.Compiled); private static readonly Regex FileNameCleanupRegex = new Regex(@"([- ._])(\1)+", RegexOptions.Compiled);
private static readonly Regex TrimSeparatorsRegex = new Regex(@"[- ._]$", RegexOptions.Compiled); private static readonly Regex TrimSeparatorsRegex = new Regex(@"[- ._]$", RegexOptions.Compiled);
private static readonly Regex ScenifyRemoveChars = new Regex(@"(?<=\s)(,|<|>|\/|\\|;|:|'|""|\||`|~|!|\?|@|$|%|^|\*|-|_|=){1}(?=\s)|('|:|\?|,)(?=(?:(?:s|m)\s)|\s|$)|(\(|\)|\[|\]|\{|\})", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex ScenifyRemoveChars = new Regex(@"(?<=\s)(,|<|>|\/|\\|;|:|'|""|\||`||~|!|\?|@|$|%|^|\*|-|_|=){1}(?=\s)|('|`||:|\?|,)(?=(?:(?:s|m|t|ve|ll|d|re)\s)|\s|$)|(\(|\)|\[|\]|\{|\})", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex ScenifyReplaceChars = new Regex(@"[\/]", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex ScenifyReplaceChars = new Regex(@"[\/]", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex TitlePrefixRegex = new Regex(@"^(The|An|A) (.*?)((?: *\([^)]+\))*)$", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex TitlePrefixRegex = new Regex(@"^(The|An|A) (.*?)((?: *\([^)]+\))*)$", RegexOptions.Compiled | RegexOptions.IgnoreCase);

Loading…
Cancel
Save