From ea1ed86d7a122fb48fa52c0391d29c53c734b315 Mon Sep 17 00:00:00 2001 From: monestri <63887617+monestri@users.noreply.github.com> Date: Thu, 23 Apr 2020 01:41:17 -0400 Subject: [PATCH] alpharatio: disable season only search. Resolves #8244 --- src/Jackett.Common/Indexers/AlphaRatio.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Jackett.Common/Indexers/AlphaRatio.cs b/src/Jackett.Common/Indexers/AlphaRatio.cs index b1a4d85e4..38e4d911c 100644 --- a/src/Jackett.Common/Indexers/AlphaRatio.cs +++ b/src/Jackett.Common/Indexers/AlphaRatio.cs @@ -58,7 +58,15 @@ namespace Jackett.Common.Indexers AddCategoryMapping(30, TorznabCatType.Other, "Misc"); } - // Alpharatio can't handle dots in the searchstr - protected override string GetSearchTerm(TorznabQuery query) => query.GetQueryString().Replace(".", " "); + protected override string GetSearchTerm(TorznabQuery query) + { + // Ignore season search without episode. Alpharatio doesn't support it. + var searchTerm = string.IsNullOrWhiteSpace(query.Episode) + ? query.SanitizedSearchTerm + : query.GetQueryString(); + + // Alpharatio can't handle dots in the searchstr + return searchTerm.Replace(".", " "); + } } }