mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-17 21:26:13 -04:00
Compare commits
7 Commits
api-docs
...
v4.0.14.29
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
640e3e5d44 | ||
|
|
1260d3c800 | ||
|
|
feeed9a7cf | ||
|
|
c8cb74a976 | ||
|
|
7193acb5ee | ||
|
|
6f1fc1686f | ||
|
|
b7407837b7 |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -22,7 +22,7 @@ env:
|
|||||||
FRAMEWORK: net6.0
|
FRAMEWORK: net6.0
|
||||||
RAW_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
RAW_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
||||||
SONARR_MAJOR_VERSION: 4
|
SONARR_MAJOR_VERSION: 4
|
||||||
VERSION: 4.0.13
|
VERSION: 4.0.14
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
backend:
|
backend:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using NLog;
|
||||||
using NzbDrone.Core.Download.TrackedDownloads;
|
using NzbDrone.Core.Download.TrackedDownloads;
|
||||||
using NzbDrone.Core.Indexers;
|
using NzbDrone.Core.Indexers;
|
||||||
using NzbDrone.Core.MediaFiles.EpisodeImport;
|
using NzbDrone.Core.MediaFiles.EpisodeImport;
|
||||||
@@ -14,15 +14,17 @@ public interface IRejectedImportService
|
|||||||
public class RejectedImportService : IRejectedImportService
|
public class RejectedImportService : IRejectedImportService
|
||||||
{
|
{
|
||||||
private readonly ICachedIndexerSettingsProvider _cachedIndexerSettingsProvider;
|
private readonly ICachedIndexerSettingsProvider _cachedIndexerSettingsProvider;
|
||||||
|
private readonly Logger _logger;
|
||||||
|
|
||||||
public RejectedImportService(ICachedIndexerSettingsProvider cachedIndexerSettingsProvider)
|
public RejectedImportService(ICachedIndexerSettingsProvider cachedIndexerSettingsProvider, Logger logger)
|
||||||
{
|
{
|
||||||
_cachedIndexerSettingsProvider = cachedIndexerSettingsProvider;
|
_cachedIndexerSettingsProvider = cachedIndexerSettingsProvider;
|
||||||
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Process(TrackedDownload trackedDownload, ImportResult importResult)
|
public bool Process(TrackedDownload trackedDownload, ImportResult importResult)
|
||||||
{
|
{
|
||||||
if (importResult.Result != ImportResultType.Rejected || importResult.ImportDecision.LocalEpisode == null)
|
if (importResult.Result != ImportResultType.Rejected || trackedDownload.RemoteEpisode?.Release == null)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -30,19 +32,27 @@ public class RejectedImportService : IRejectedImportService
|
|||||||
var indexerSettings = _cachedIndexerSettingsProvider.GetSettings(trackedDownload.RemoteEpisode.Release.IndexerId);
|
var indexerSettings = _cachedIndexerSettingsProvider.GetSettings(trackedDownload.RemoteEpisode.Release.IndexerId);
|
||||||
var rejectionReason = importResult.ImportDecision.Rejections.FirstOrDefault()?.Reason;
|
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 &&
|
if (rejectionReason == ImportRejectionReason.DangerousFile &&
|
||||||
indexerSettings.FailDownloads.Contains(FailDownloads.PotentiallyDangerous))
|
indexerSettings.FailDownloads.Contains(FailDownloads.PotentiallyDangerous))
|
||||||
{
|
{
|
||||||
|
_logger.Trace("Download '{0}' contains potentially dangerous file, marking as failed", trackedDownload.DownloadItem.Title);
|
||||||
trackedDownload.Fail();
|
trackedDownload.Fail();
|
||||||
}
|
}
|
||||||
else if (rejectionReason == ImportRejectionReason.ExecutableFile &&
|
else if (rejectionReason == ImportRejectionReason.ExecutableFile &&
|
||||||
indexerSettings.FailDownloads.Contains(FailDownloads.Executables))
|
indexerSettings.FailDownloads.Contains(FailDownloads.Executables))
|
||||||
{
|
{
|
||||||
|
_logger.Trace("Download '{0}' contains executable file, marking as failed", trackedDownload.DownloadItem.Title);
|
||||||
trackedDownload.Fail();
|
trackedDownload.Fail();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
trackedDownload.Warn(new TrackedDownloadStatusMessage(importResult.Errors.First(), new List<string>()));
|
trackedDownload.Warn(new TrackedDownloadStatusMessage(trackedDownload.DownloadItem.Title, importResult.Errors));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ namespace NzbDrone.Core.Download.TrackedDownloads
|
|||||||
{
|
{
|
||||||
Status = TrackedDownloadStatus.Error;
|
Status = TrackedDownloadStatus.Error;
|
||||||
State = TrackedDownloadState.FailedPending;
|
State = TrackedDownloadState.FailedPending;
|
||||||
|
|
||||||
|
// Set CanBeRemoved to allow the failed item to be removed from the client
|
||||||
|
DownloadItem.CanBeRemoved = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ namespace NzbDrone.Core.MediaFiles
|
|||||||
|
|
||||||
private static List<string> _dangerousExtensions = new List<string>
|
private static List<string> _dangerousExtensions = new List<string>
|
||||||
{
|
{
|
||||||
|
".arj",
|
||||||
".lnk",
|
".lnk",
|
||||||
|
".lzh",
|
||||||
".ps1",
|
".ps1",
|
||||||
".scr",
|
".scr",
|
||||||
".vbs",
|
".vbs",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<PackageReference Include="Servarr.FluentMigrator.Runner.SQLite" Version="3.3.2.9" />
|
<PackageReference Include="Servarr.FluentMigrator.Runner.SQLite" Version="3.3.2.9" />
|
||||||
<PackageReference Include="Servarr.FluentMigrator.Runner.Postgres" Version="3.3.2.9" />
|
<PackageReference Include="Servarr.FluentMigrator.Runner.Postgres" Version="3.3.2.9" />
|
||||||
<PackageReference Include="FluentValidation" Version="9.5.4" />
|
<PackageReference Include="FluentValidation" Version="9.5.4" />
|
||||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.6" />
|
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.7" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
<PackageReference Include="NLog" Version="5.3.4" />
|
<PackageReference Include="NLog" Version="5.3.4" />
|
||||||
<PackageReference Include="MonoTorrent" Version="2.0.7" />
|
<PackageReference Include="MonoTorrent" Version="2.0.7" />
|
||||||
|
|||||||
Reference in New Issue
Block a user