diff --git a/src/NzbDrone.Core/Indexers/Definitions/Nebulance.cs b/src/NzbDrone.Core/Indexers/Definitions/Nebulance.cs index f2bb6cee6..dba9ce9e4 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Nebulance.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Nebulance.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Globalization; +using System.Linq; using System.Net; using System.Text; using System.Text.Json.Serialization; @@ -67,6 +68,26 @@ namespace NzbDrone.Core.Indexers.Definitions return Task.FromResult(request); } + protected override IList CleanupReleases(IEnumerable releases, SearchCriteriaBase searchCriteria) + { + var cleanReleases = base.CleanupReleases(releases, searchCriteria); + + return FilterReleasesByQuery(cleanReleases, searchCriteria).ToList(); + } + + protected override IEnumerable FilterReleasesByQuery(IEnumerable releases, SearchCriteriaBase searchCriteria) + { + if (!searchCriteria.IsRssSearch && + searchCriteria.IsIdSearch && + searchCriteria is TvSearchCriteria tvSearchCriteria && + tvSearchCriteria.EpisodeSearchString.IsNotNullOrWhiteSpace()) + { + releases = releases.Where(r => r.Title.IsNotNullOrWhiteSpace() && r.Title.ContainsIgnoreCase(tvSearchCriteria.EpisodeSearchString)).ToList(); + } + + return releases; + } + private IndexerCapabilities SetCapabilities() { var caps = new IndexerCapabilities diff --git a/src/NzbDrone.Core/Indexers/IndexerBase.cs b/src/NzbDrone.Core/Indexers/IndexerBase.cs index 489bdbb27..2e2e7cdd9 100644 --- a/src/NzbDrone.Core/Indexers/IndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/IndexerBase.cs @@ -149,7 +149,7 @@ namespace NzbDrone.Core.Indexers return result.DistinctBy(v => v.Guid).ToList(); } - protected IEnumerable FilterReleasesByQuery(IEnumerable releases, SearchCriteriaBase searchCriteria) + protected virtual IEnumerable FilterReleasesByQuery(IEnumerable releases, SearchCriteriaBase searchCriteria) { var commonWords = new[] { "and", "the", "an", "of" };