@ -9,17 +9,17 @@ namespace NzbDrone.Core.IndexerSearch
{
public class SeriesSearchService : IExecute < SeriesSearchCommand >
{
private readonly ISe asonService _season Service;
private readonly ISe riesService _series Service;
private readonly ISearchForNzb _nzbSearchService ;
private readonly IDownloadApprovedReports _downloadApprovedReports ;
private readonly Logger _logger ;
public SeriesSearchService ( ISe asonService season Service,
public SeriesSearchService ( ISe riesService series Service,
ISearchForNzb nzbSearchService ,
IDownloadApprovedReports downloadApprovedReports ,
Logger logger )
{
_se asonService = season Service;
_se riesService = series Service;
_nzbSearchService = nzbSearchService ;
_downloadApprovedReports = downloadApprovedReports ;
_logger = logger ;
@ -27,14 +27,11 @@ namespace NzbDrone.Core.IndexerSearch
public void Execute ( SeriesSearchCommand message )
{
var seasons = _seasonService . GetSeasonsBySeries ( message . SeriesId )
. Where ( s = > s . SeasonNumber > 0 )
. OrderBy ( s = > s . SeasonNumber )
. ToList ( ) ;
var series = _seriesService . GetSeries ( message . SeriesId ) ;
var downloadedCount = 0 ;
foreach ( var season in se asons)
foreach ( var season in se ries. Se asons)
{
var decisions = _nzbSearchService . SeasonSearch ( message . SeriesId , season . SeasonNumber ) ;
downloadedCount + = _downloadApprovedReports . DownloadApproved ( decisions ) . Count ;