|
|
@ -9,8 +9,8 @@ namespace NzbDrone.Core.Download
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public interface IFailedDownloadService
|
|
|
|
public interface IFailedDownloadService
|
|
|
|
{
|
|
|
|
{
|
|
|
|
void MarkAsFailed(int historyId);
|
|
|
|
void MarkAsFailed(int historyId, bool skipRedownload = false);
|
|
|
|
void MarkAsFailed(string downloadId);
|
|
|
|
void MarkAsFailed(string downloadId, bool skipRedownload = false);
|
|
|
|
void Check(TrackedDownload trackedDownload);
|
|
|
|
void Check(TrackedDownload trackedDownload);
|
|
|
|
void ProcessFailed(TrackedDownload trackedDownload);
|
|
|
|
void ProcessFailed(TrackedDownload trackedDownload);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -30,14 +30,14 @@ namespace NzbDrone.Core.Download
|
|
|
|
_eventAggregator = eventAggregator;
|
|
|
|
_eventAggregator = eventAggregator;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void MarkAsFailed(int historyId)
|
|
|
|
public void MarkAsFailed(int historyId, bool skipRedownload = false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var history = _historyService.Get(historyId);
|
|
|
|
var history = _historyService.Get(historyId);
|
|
|
|
|
|
|
|
|
|
|
|
var downloadId = history.DownloadId;
|
|
|
|
var downloadId = history.DownloadId;
|
|
|
|
if (downloadId.IsNullOrWhiteSpace())
|
|
|
|
if (downloadId.IsNullOrWhiteSpace())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
PublishDownloadFailedEvent(new List<EpisodeHistory> { history }, "Manually marked as failed");
|
|
|
|
PublishDownloadFailedEvent(new List<EpisodeHistory> { history }, "Manually marked as failed", skipRedownload: skipRedownload);
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -57,7 +57,7 @@ namespace NzbDrone.Core.Download
|
|
|
|
PublishDownloadFailedEvent(grabbedHistory, "Manually marked as failed");
|
|
|
|
PublishDownloadFailedEvent(grabbedHistory, "Manually marked as failed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void MarkAsFailed(string downloadId)
|
|
|
|
public void MarkAsFailed(string downloadId, bool skipRedownload = false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var history = _historyService.Find(downloadId, EpisodeHistoryEventType.Grabbed);
|
|
|
|
var history = _historyService.Find(downloadId, EpisodeHistoryEventType.Grabbed);
|
|
|
|
|
|
|
|
|
|
|
@ -65,7 +65,7 @@ namespace NzbDrone.Core.Download
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var trackedDownload = _trackedDownloadService.Find(downloadId);
|
|
|
|
var trackedDownload = _trackedDownloadService.Find(downloadId);
|
|
|
|
|
|
|
|
|
|
|
|
PublishDownloadFailedEvent(history, "Manually marked as failed", trackedDownload);
|
|
|
|
PublishDownloadFailedEvent(history, "Manually marked as failed", trackedDownload, skipRedownload: skipRedownload);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -125,7 +125,7 @@ namespace NzbDrone.Core.Download
|
|
|
|
PublishDownloadFailedEvent(grabbedItems, failure, trackedDownload);
|
|
|
|
PublishDownloadFailedEvent(grabbedItems, failure, trackedDownload);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void PublishDownloadFailedEvent(List<EpisodeHistory> historyItems, string message, TrackedDownload trackedDownload = null)
|
|
|
|
private void PublishDownloadFailedEvent(List<EpisodeHistory> historyItems, string message, TrackedDownload trackedDownload = null, bool skipRedownload = false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var historyItem = historyItems.First();
|
|
|
|
var historyItem = historyItems.First();
|
|
|
|
|
|
|
|
|
|
|
@ -140,7 +140,8 @@ namespace NzbDrone.Core.Download
|
|
|
|
Message = message,
|
|
|
|
Message = message,
|
|
|
|
Data = historyItem.Data,
|
|
|
|
Data = historyItem.Data,
|
|
|
|
TrackedDownload = trackedDownload,
|
|
|
|
TrackedDownload = trackedDownload,
|
|
|
|
Languages = historyItem.Languages
|
|
|
|
Languages = historyItem.Languages,
|
|
|
|
|
|
|
|
SkipRedownload = skipRedownload
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
_eventAggregator.PublishEvent(downloadFailedEvent);
|
|
|
|
_eventAggregator.PublishEvent(downloadFailedEvent);
|
|
|
|