New: Added rudimentary Anime search by tvdb episodenumber to BTN.

This commit is contained in:
Taloth Saldono 2015-02-23 20:15:55 +01:00
parent e143b18df3
commit 402d6b5411
1 changed files with 18 additions and 2 deletions

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http; using NzbDrone.Common.Http;
@ -71,7 +72,6 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet
} }
} }
return pageableRequest; return pageableRequest;
} }
@ -93,7 +93,23 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet
public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria) public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
{ {
return new List<IEnumerable<IndexerRequest>>(); var pageableRequest = new List<IEnumerable<IndexerRequest>>();
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<IEnumerable<IndexerRequest>> GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria) public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)