From 402d6b54119fe2a23900bffd8e573772864729f7 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Mon, 23 Feb 2015 20:15:55 +0100 Subject: [PATCH] New: Added rudimentary Anime search by tvdb episodenumber to BTN. --- .../BroadcastheNetRequestGenerator.cs | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetRequestGenerator.cs b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetRequestGenerator.cs index bec77ef84..ea2b70fef 100644 --- a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetRequestGenerator.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using System.Collections.Generic; using NzbDrone.Common.Extensions; using NzbDrone.Common.Http; @@ -71,7 +72,6 @@ public virtual IList> GetSearchRequests(SeasonSearch } } - return pageableRequest; } @@ -93,7 +93,23 @@ public virtual IList> GetSearchRequests(DailyEpisode public virtual IList> GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria) { - return new List>(); + var pageableRequest = new List>(); + + var parameters = new BroadcastheNetTorrentQuery(); + if (AddSeriesSearchParameters(parameters, searchCriteria)) + { + foreach (var episode in searchCriteria.Episodes) + { + parameters = parameters.Clone(); + + parameters.Category = "Episode"; + parameters.Name = String.Format("S{0:00}E{1:00}", episode.SeasonNumber, episode.EpisodeNumber); + + pageableRequest.AddIfNotNull(GetPagedRequests(MaxPages, parameters)); + } + } + + return pageableRequest; } public virtual IList> GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)