Fixed: Remove apostrophe, backtick in contractions

This commit is contained in:
diamondpete 2024-07-17 00:36:29 -04:00 committed by GitHub
parent 1a1c8e6c08
commit 6a4824c029
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -72,6 +72,14 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
[TestCase("I'm the Boss", "Im the Boss")] [TestCase("I'm the Boss", "Im the Boss")]
[TestCase("The Title's", "The Title's")] [TestCase("The Title's", "The Title's")]
[TestCase("I'm after I'm", "Im after I'm")] [TestCase("I'm after I'm", "Im after I'm")]
[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)

View File

@ -72,7 +72,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);
// TODO: Support Written numbers (One, Two, etc) and Roman Numerals (I, II, III etc) // TODO: Support Written numbers (One, Two, etc) and Roman Numerals (I, II, III etc)