mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-24 22:35:49 -04:00
Command queue
New: Adding multiple series will queue them instead of running all at once New: Slower scheduled tasks won't be block others from running
This commit is contained in:
@@ -12,14 +12,17 @@ namespace NzbDrone.Core.Download
|
||||
{
|
||||
private readonly IConfigService _configService;
|
||||
private readonly IEpisodeService _episodeService;
|
||||
private readonly ICommandExecutor _commandExecutor;
|
||||
private readonly IManageCommandQueue _commandQueueManager;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public RedownloadFailedDownloadService(IConfigService configService, IEpisodeService episodeService, ICommandExecutor commandExecutor, Logger logger)
|
||||
public RedownloadFailedDownloadService(IConfigService configService,
|
||||
IEpisodeService episodeService,
|
||||
IManageCommandQueue commandQueueManager,
|
||||
Logger logger)
|
||||
{
|
||||
_configService = configService;
|
||||
_episodeService = episodeService;
|
||||
_commandExecutor = commandExecutor;
|
||||
_commandQueueManager = commandQueueManager;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -35,7 +38,7 @@ namespace NzbDrone.Core.Download
|
||||
{
|
||||
_logger.Debug("Failed download only contains one episode, searching again");
|
||||
|
||||
_commandExecutor.PublishCommandAsync(new EpisodeSearchCommand(message.EpisodeIds));
|
||||
_commandQueueManager.Push(new EpisodeSearchCommand(message.EpisodeIds));
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -47,7 +50,7 @@ namespace NzbDrone.Core.Download
|
||||
{
|
||||
_logger.Debug("Failed download was entire season, searching again");
|
||||
|
||||
_commandExecutor.PublishCommandAsync(new SeasonSearchCommand
|
||||
_commandQueueManager.Push(new SeasonSearchCommand
|
||||
{
|
||||
SeriesId = message.SeriesId,
|
||||
SeasonNumber = seasonNumber
|
||||
@@ -58,7 +61,7 @@ namespace NzbDrone.Core.Download
|
||||
|
||||
_logger.Debug("Failed download contains multiple episodes, probably a double episode, searching again");
|
||||
|
||||
_commandExecutor.PublishCommandAsync(new EpisodeSearchCommand(message.EpisodeIds));
|
||||
_commandQueueManager.Push(new EpisodeSearchCommand(message.EpisodeIds));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user