Fixed: Rejected Imports with no associated release or indexer

v5-develop
Stevie Robinson 4 days ago committed by GitHub
parent b122ee9670
commit 31e02bdead
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -22,7 +22,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 +30,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(importResult.Errors.First(), new List<string>()));
return true;
}
if (rejectionReason == ImportRejectionReason.DangerousFile &&
indexerSettings.FailDownloads.Contains(FailDownloads.PotentiallyDangerous))
{

Loading…
Cancel
Save