|
|
@ -33,6 +33,44 @@ namespace NzbDrone.Core.IndexerSearch
|
|
|
|
_logger = logger;
|
|
|
|
_logger = logger;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Execute(MoviesSearchCommand message)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var downloadedCount = 0;
|
|
|
|
|
|
|
|
foreach (var movieId in message.MovieIds)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var movies = _movieService.GetMovie(movieId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!movies.Monitored)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_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);
|
|
|
|
|
|
|
|
downloadedCount += _processDownloadDecisions.ProcessDecisions(decisions).Grabbed.Count;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
_logger.ProgressInfo("Movie search completed. {0} reports downloaded.", downloadedCount);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Execute(MissingMoviesSearchCommand message)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
List<Movie> movies = _movieService.MoviesWithoutFiles(new PagingSpec<Movie>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Page = 1,
|
|
|
|
|
|
|
|
PageSize = 100000,
|
|
|
|
|
|
|
|
SortDirection = SortDirection.Ascending,
|
|
|
|
|
|
|
|
SortKey = "Id",
|
|
|
|
|
|
|
|
FilterExpression = _movieService.ConstructFilterExpression(message.FilterKey, message.FilterValue)
|
|
|
|
|
|
|
|
}).Records.ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var queue = _queueService.GetQueue().Select(q => q.Movie.Id);
|
|
|
|
|
|
|
|
var missing = movies.Where(e => !queue.Contains(e.Id)).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SearchForMissingMovies(missing, message.Trigger == CommandTrigger.Manual);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SearchForMissingMovies(List<Movie> movies, bool userInvokedSearch)
|
|
|
|
private void SearchForMissingMovies(List<Movie> movies, bool userInvokedSearch)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.ProgressInfo("Performing missing search for {0} movies", movies.Count);
|
|
|
|
_logger.ProgressInfo("Performing missing search for {0} movies", movies.Count);
|
|
|
@ -61,45 +99,7 @@ namespace NzbDrone.Core.IndexerSearch
|
|
|
|
_logger.ProgressInfo("Completed missing search for {0} movies. {1} reports downloaded.", movies.Count, downloadedCount);
|
|
|
|
_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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!series.Monitored)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_logger.Debug("Movie {0} is not monitored, skipping search", series.Title);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var decisions = _nzbSearchService.MovieSearch(movieId, false);//_nzbSearchService.SeasonSearch(message.MovieId, season.SeasonNumber, false, message.Trigger == CommandTrigger.Manual);
|
|
|
|
|
|
|
|
downloadedCount += _processDownloadDecisions.ProcessDecisions(decisions).Grabbed.Count;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
_logger.ProgressInfo("Movie search completed. {0} reports downloaded.", downloadedCount);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Execute(MissingMoviesSearchCommand message)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
List<Movie> movies;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
movies = _movieService.MoviesWithoutFiles(new PagingSpec<Movie>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Page = 1,
|
|
|
|
|
|
|
|
PageSize = 100000,
|
|
|
|
|
|
|
|
SortDirection = SortDirection.Ascending,
|
|
|
|
|
|
|
|
SortKey = "Id",
|
|
|
|
|
|
|
|
FilterExpression = _movieService.ConstructFilterExpression(message.FilterKey, message.FilterValue)
|
|
|
|
|
|
|
|
}).Records.ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var queue = _queueService.GetQueue().Select(q => q.Movie.Id);
|
|
|
|
|
|
|
|
var missing = movies.Where(e => !queue.Contains(e.Id)).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SearchForMissingMovies(missing, message.Trigger == CommandTrigger.Manual);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|