From 8bc0ab981c0d9a4a147bb3ac78824dcf5d3c0e9d Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Mon, 11 Jan 2021 21:03:47 +0100 Subject: [PATCH] Fixed: Dailiezearch. --- .../Newznab/NewznabRequestGenerator.cs | 51 ++++++++++++++++--- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Newznab/NewznabRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Newznab/NewznabRequestGenerator.cs index 20e442e18..5c512d0b8 100644 --- a/src/NzbDrone.Core/Indexers/Newznab/NewznabRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Newznab/NewznabRequestGenerator.cs @@ -206,9 +206,28 @@ namespace NzbDrone.Core.Indexers.Newznab { var pageableRequests = new IndexerPageableRequestChain(); - AddTvIdPageableRequests(pageableRequests, Settings.Categories, searchCriteria, - string.Format("&season={0:yyyy}&ep={0:MM}/{0:dd}", - searchCriteria.AirDate)); + if (searchCriteria.SearchMode.HasFlag(SearchMode.SearchID) || searchCriteria.SearchMode == SearchMode.Default) + { + AddTvIdPageableRequests(pageableRequests, Settings.Categories, searchCriteria, + string.Format("&season={0:yyyy}&ep={0:MM}/{0:dd}", + searchCriteria.AirDate)); + } + + if (searchCriteria.SearchMode.HasFlag(SearchMode.SearchTitle)) + { + AddTitlePageableRequests(pageableRequests, Settings.Categories, searchCriteria, + string.Format("&season={0:yyyy}&ep={0:MM}/{0:dd}", + searchCriteria.AirDate)); + } + + pageableRequests.AddTier(); + + if (searchCriteria.SearchMode == SearchMode.Default) + { + AddTitlePageableRequests(pageableRequests, Settings.Categories, searchCriteria, + string.Format("&season={0:yyyy}&ep={0:MM}/{0:dd}", + searchCriteria.AirDate)); + } return pageableRequests; } @@ -217,9 +236,29 @@ namespace NzbDrone.Core.Indexers.Newznab { var pageableRequests = new IndexerPageableRequestChain(); - AddTvIdPageableRequests(pageableRequests, Settings.Categories, searchCriteria, - string.Format("&season={0}", - searchCriteria.Year)); + if (searchCriteria.SearchMode.HasFlag(SearchMode.SearchID) || searchCriteria.SearchMode == SearchMode.Default) + { + + AddTvIdPageableRequests(pageableRequests, Settings.Categories, searchCriteria, + string.Format("&season={0}", + searchCriteria.Year)); + } + + if (searchCriteria.SearchMode.HasFlag(SearchMode.SearchTitle)) + { + AddTitlePageableRequests(pageableRequests, Settings.Categories, searchCriteria, + string.Format("&season={0}", + searchCriteria.Year)); + } + + pageableRequests.AddTier(); + + if (searchCriteria.SearchMode == SearchMode.Default) + { + AddTitlePageableRequests(pageableRequests, Settings.Categories, searchCriteria, + string.Format("&season={0}", + searchCriteria.Year)); + } return pageableRequests; }