1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 02:22:31 +01:00

New: Manual single episode searches on BTN will now also search for season packs to simplify manually grabbing a season pack.

This commit is contained in:
Taloth Saldono 2015-02-24 20:10:44 +01:00
parent be338a651e
commit 14a99a28cc
2 changed files with 16 additions and 0 deletions

View File

@ -32,6 +32,12 @@ public Decision IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase se
return Decision.Reject("Wrong season");
}
if (!remoteEpisode.ParsedEpisodeInfo.EpisodeNumbers.Any())
{
_logger.Debug("Full season result during single episode search, skipping.");
return Decision.Reject("Full season pack");
}
if (!remoteEpisode.ParsedEpisodeInfo.EpisodeNumbers.Contains(singleEpisodeSpec.EpisodeNumber))
{
_logger.Debug("Episode number does not match searched episode number, skipping.");

View File

@ -44,6 +44,16 @@ public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(SingleEpisod
pageableRequest.AddIfNotNull(GetPagedRequests(MaxPages, parameters));
}
foreach (var seasonNumber in searchCriteria.Episodes.Select(v => v.SeasonNumber).Distinct())
{
parameters = parameters.Clone();
parameters.Category = "Season";
parameters.Name = String.Format("Season {0}", seasonNumber);
pageableRequest.AddIfNotNull(GetPagedRequests(MaxPages, parameters));
}
}
return pageableRequest;