mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-25 22:37:27 -04:00
Onedr0p/3 8 17 (#1087)
* Move ToUrlSlug to Parser, fix issue with trakt lists that have non-alphanumeric characters * Move "Add movies" link in nav to the first link * String interpolation! * Add Limit to Trakt List Settings to limit the amount of movies returned, 50 by default * Updates to FailedDownload * Update DownloadService and CompleteDownloadService
This commit is contained in:
@@ -12,17 +12,17 @@ namespace NzbDrone.Core.Download
|
||||
public class RedownloadFailedDownloadService : IHandleAsync<DownloadFailedEvent>
|
||||
{
|
||||
private readonly IConfigService _configService;
|
||||
private readonly IEpisodeService _episodeService;
|
||||
private readonly IMovieService _movieService;
|
||||
private readonly IManageCommandQueue _commandQueueManager;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public RedownloadFailedDownloadService(IConfigService configService,
|
||||
IEpisodeService episodeService,
|
||||
IMovieService movieService,
|
||||
IManageCommandQueue commandQueueManager,
|
||||
Logger logger)
|
||||
{
|
||||
_configService = configService;
|
||||
_episodeService = episodeService;
|
||||
_movieService = movieService;
|
||||
_commandQueueManager = commandQueueManager;
|
||||
_logger = logger;
|
||||
}
|
||||
@@ -38,40 +38,8 @@ namespace NzbDrone.Core.Download
|
||||
if (message.MovieId != 0)
|
||||
{
|
||||
_logger.Debug("Failed download contains a movie, searching again.");
|
||||
|
||||
_commandQueueManager.Push(new MoviesSearchCommand { MovieIds = new List<int> { message.MovieId } });
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (message.EpisodeIds.Count == 1)
|
||||
{
|
||||
_logger.Debug("Failed download only contains one episode, searching again");
|
||||
|
||||
_commandQueueManager.Push(new EpisodeSearchCommand(message.EpisodeIds));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var seasonNumber = _episodeService.GetEpisode(message.EpisodeIds.First()).SeasonNumber;
|
||||
var episodesInSeason = _episodeService.GetEpisodesBySeason(message.SeriesId, seasonNumber);
|
||||
|
||||
if (message.EpisodeIds.Count == episodesInSeason.Count)
|
||||
{
|
||||
_logger.Debug("Failed download was entire season, searching again");
|
||||
|
||||
_commandQueueManager.Push(new SeasonSearchCommand
|
||||
{
|
||||
SeriesId = message.SeriesId,
|
||||
SeasonNumber = seasonNumber
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
_logger.Debug("Failed download contains multiple episodes, probably a double episode, searching again");
|
||||
|
||||
_commandQueueManager.Push(new EpisodeSearchCommand(message.EpisodeIds));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user