From e1862653f9c4ddcf7d83abc1d33117133f0b69de Mon Sep 17 00:00:00 2001 From: ta264 Date: Wed, 5 Aug 2020 22:35:26 +0100 Subject: [PATCH] Fixed: Don't strip apostrophes --- .../IndexerSearchTests/SearchDefinitionFixture.cs | 2 +- .../IndexerSearch/Definitions/SearchCriteriaBase.cs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/NzbDrone.Core.Test/IndexerSearchTests/SearchDefinitionFixture.cs b/src/NzbDrone.Core.Test/IndexerSearchTests/SearchDefinitionFixture.cs index 404ff54b4..873e0e450 100644 --- a/src/NzbDrone.Core.Test/IndexerSearchTests/SearchDefinitionFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerSearchTests/SearchDefinitionFixture.cs @@ -20,7 +20,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests [TestCase("American III: Solitary Man", "American+III+Solitary+Man")] [TestCase("Sad Clowns & Hillbillies", "Sad+Clowns+Hillbillies")] [TestCase("¿Quién sabe?", "Quien+sabe")] - [TestCase("Seal the Deal & Let’s Boogie", "Seal+the+Deal+Lets+Boogie")] + [TestCase("Seal the Deal & Let’s Boogie", "Seal+the+Deal+Let’s+Boogie")] [TestCase("Section.80", "Section+80")] public void should_replace_some_special_characters(string album, string expected) { diff --git a/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs b/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs index 070854088..2f0512daa 100644 --- a/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs +++ b/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs @@ -8,8 +8,7 @@ namespace NzbDrone.Core.IndexerSearch.Definitions { public abstract class SearchCriteriaBase { - private static readonly Regex SpecialCharacter = new Regex(@"[`'’]", RegexOptions.IgnoreCase | RegexOptions.Compiled); - private static readonly Regex NonWord = new Regex(@"[\W]", RegexOptions.IgnoreCase | RegexOptions.Compiled); + private static readonly Regex NonWord = new Regex(@"[^\w`'’]", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly Regex BeginningThe = new Regex(@"^the\s", RegexOptions.IgnoreCase | RegexOptions.Compiled); public virtual bool MonitoredBooksOnly { get; set; } @@ -36,7 +35,6 @@ namespace NzbDrone.Core.IndexerSearch.Definitions cleanTitle = cleanTitle.Replace(" & ", " "); cleanTitle = cleanTitle.Replace(".", " "); - cleanTitle = SpecialCharacter.Replace(cleanTitle, ""); cleanTitle = NonWord.Replace(cleanTitle, "+"); //remove any repeating +s