|
|
|
@ -33,44 +33,16 @@ namespace NzbDrone.Core.IndexerSearch
|
|
|
|
|
_logger = logger;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SearchForMissingMovies(List<Movie> movies, bool userInvokedSearch)
|
|
|
|
|
{
|
|
|
|
|
_logger.ProgressInfo("Performing missing search for {0} movies", movies.Count);
|
|
|
|
|
var downloadedCount = 0;
|
|
|
|
|
|
|
|
|
|
foreach (var movieId in movies.GroupBy(e => e.Id))
|
|
|
|
|
{
|
|
|
|
|
List<DownloadDecision> decisions;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
decisions = _nzbSearchService.MovieSearch(movieId.Key, userInvokedSearch);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
var message = String.Format("Unable to search for missing movie {0}", movieId.Key);
|
|
|
|
|
_logger.Error(ex, message);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var processed = _processDownloadDecisions.ProcessDecisions(decisions);
|
|
|
|
|
|
|
|
|
|
downloadedCount += processed.Grabbed.Count;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_logger.ProgressInfo("Completed missing search for {0} movies. {1} reports downloaded.", movies.Count, downloadedCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Execute(MoviesSearchCommand message)
|
|
|
|
|
{
|
|
|
|
|
var downloadedCount = 0;
|
|
|
|
|
foreach (var movieId in message.MovieIds)
|
|
|
|
|
{
|
|
|
|
|
var series = _movieService.GetMovie(movieId);
|
|
|
|
|
var movies = _movieService.GetMovie(movieId);
|
|
|
|
|
|
|
|
|
|
if (!series.Monitored)
|
|
|
|
|
if (!movies.Monitored)
|
|
|
|
|
{
|
|
|
|
|
_logger.Debug("Movie {0} is not monitored, skipping search", series.Title);
|
|
|
|
|
_logger.Debug("Movie {0} is not monitored, skipping search", movies.Title);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var decisions = _nzbSearchService.MovieSearch(movieId, false);//_nzbSearchService.SeasonSearch(message.MovieId, season.SeasonNumber, false, message.Trigger == CommandTrigger.Manual);
|
|
|
|
@ -82,9 +54,7 @@ namespace NzbDrone.Core.IndexerSearch
|
|
|
|
|
|
|
|
|
|
public void Execute(MissingMoviesSearchCommand message)
|
|
|
|
|
{
|
|
|
|
|
List<Movie> movies;
|
|
|
|
|
|
|
|
|
|
movies = _movieService.MoviesWithoutFiles(new PagingSpec<Movie>
|
|
|
|
|
List<Movie> movies = _movieService.MoviesWithoutFiles(new PagingSpec<Movie>
|
|
|
|
|
{
|
|
|
|
|
Page = 1,
|
|
|
|
|
PageSize = 100000,
|
|
|
|
@ -101,5 +71,35 @@ namespace NzbDrone.Core.IndexerSearch
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SearchForMissingMovies(List<Movie> movies, bool userInvokedSearch)
|
|
|
|
|
{
|
|
|
|
|
_logger.ProgressInfo("Performing missing search for {0} movies", movies.Count);
|
|
|
|
|
var downloadedCount = 0;
|
|
|
|
|
|
|
|
|
|
foreach (var movieId in movies.GroupBy(e => e.Id))
|
|
|
|
|
{
|
|
|
|
|
List<DownloadDecision> decisions;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
decisions = _nzbSearchService.MovieSearch(movieId.Key, userInvokedSearch);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
var message = String.Format("Unable to search for missing movie {0}", movieId.Key);
|
|
|
|
|
_logger.Error(ex, message);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var processed = _processDownloadDecisions.ProcessDecisions(decisions);
|
|
|
|
|
|
|
|
|
|
downloadedCount += processed.Grabbed.Count;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_logger.ProgressInfo("Completed missing search for {0} movies. {1} reports downloaded.", movies.Count, downloadedCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|