From a32ab3acfd3fb7a4d0ccb13432ff65563b1a808c Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 24 Sep 2024 09:29:48 +0300 Subject: [PATCH] Fixed: (AnimeBytes) Avoid specials for non-zero season searches --- src/NzbDrone.Core/Indexers/Definitions/AnimeBytes.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/AnimeBytes.cs b/src/NzbDrone.Core/Indexers/Definitions/AnimeBytes.cs index f4fd1592e..37729fd00 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/AnimeBytes.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/AnimeBytes.cs @@ -227,7 +227,13 @@ namespace NzbDrone.Core.Indexers.Definitions } } - var queryCats = _capabilities.Categories.MapTorznabCapsToTrackers(searchCriteria.Categories); + var queryCats = _capabilities.Categories.MapTorznabCapsToTrackers(searchCriteria.Categories).Distinct().ToList(); + + if (queryCats.Any() && searchCriteria is TvSearchCriteria { Season: > 0 }) + { + // Avoid searching for specials if it's a non-zero season search + queryCats.RemoveAll(cat => cat is "anime[tv_special]" or "anime[ova]" or "anime[ona]" or "anime[dvd_special]" or "anime[bd_special]"); + } if (queryCats.Any()) { @@ -246,9 +252,7 @@ namespace NzbDrone.Core.Indexers.Definitions searchUrl += "?" + parameters.GetQueryString(); - var request = new IndexerRequest(searchUrl, HttpAccept.Json); - - yield return request; + yield return new IndexerRequest(searchUrl, HttpAccept.Json); } private static string CleanSearchTerm(string term)