mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-03-05 13:20:20 -05:00
Compare commits
2 Commits
delete-ser
...
v4.0.13.29
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f1fc1686f | ||
|
|
b7407837b7 |
@@ -1,4 +1,3 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NzbDrone.Core.Download.TrackedDownloads;
|
||||
using NzbDrone.Core.Indexers;
|
||||
@@ -22,7 +21,7 @@ public class RejectedImportService : IRejectedImportService
|
||||
|
||||
public bool Process(TrackedDownload trackedDownload, ImportResult importResult)
|
||||
{
|
||||
if (importResult.Result != ImportResultType.Rejected || importResult.ImportDecision.LocalEpisode == null)
|
||||
if (importResult.Result != ImportResultType.Rejected || importResult.ImportDecision.LocalEpisode == null || trackedDownload.RemoteEpisode?.Release == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -30,6 +29,12 @@ public class RejectedImportService : IRejectedImportService
|
||||
var indexerSettings = _cachedIndexerSettingsProvider.GetSettings(trackedDownload.RemoteEpisode.Release.IndexerId);
|
||||
var rejectionReason = importResult.ImportDecision.Rejections.FirstOrDefault()?.Reason;
|
||||
|
||||
if (indexerSettings == null)
|
||||
{
|
||||
trackedDownload.Warn(new TrackedDownloadStatusMessage(trackedDownload.DownloadItem.Title, importResult.Errors));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (rejectionReason == ImportRejectionReason.DangerousFile &&
|
||||
indexerSettings.FailDownloads.Contains(FailDownloads.PotentiallyDangerous))
|
||||
{
|
||||
@@ -42,7 +47,7 @@ public class RejectedImportService : IRejectedImportService
|
||||
}
|
||||
else
|
||||
{
|
||||
trackedDownload.Warn(new TrackedDownloadStatusMessage(importResult.Errors.First(), new List<string>()));
|
||||
trackedDownload.Warn(new TrackedDownloadStatusMessage(trackedDownload.DownloadItem.Title, importResult.Errors));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user