Manually mark a release as failed to start failed download process (history details)

This commit is contained in:
Mark McDowall 2013-10-30 16:49:53 -07:00
commit da0f04d4c8
5 changed files with 59 additions and 7 deletions

View file

@ -9,7 +9,12 @@ using NzbDrone.Core.Messaging.Events;
namespace NzbDrone.Core.Download
{
public class FailedDownloadService : IExecute<FailedDownloadCommand>
public interface IFailedDownloadService
{
void MarkAsFailed(int historyId);
}
public class FailedDownloadService : IFailedDownloadService, IExecute<FailedDownloadCommand>
{
private readonly IProvideDownloadClient _downloadClientProvider;
private readonly IHistoryService _historyService;
@ -37,6 +42,12 @@ namespace NzbDrone.Core.Download
_downloadClient = _downloadClientProvider.GetDownloadClient();
}
public void MarkAsFailed(int historyId)
{
var item = _historyService.Get(historyId);
PublishDownloadFailedEvent(new List<History.History> {item}, "Manually marked as failed");
}
private void CheckForFailedDownloads()
{
if (!_configService.EnableFailedDownloadHandling)