mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-24 22:36:19 -04:00
New: Option to treat downloads with non-media extensions as failed
Closes #7369
This commit is contained in:
@@ -318,6 +318,11 @@ namespace NzbDrone.Core.MediaFiles
|
||||
{
|
||||
var files = _diskProvider.GetFiles(folder, true);
|
||||
|
||||
if (files.Any(file => FileExtensions.DangerousExtensions.Contains(Path.GetExtension(file))))
|
||||
{
|
||||
return RejectionResult(ImportRejectionReason.DangerousFile, "Caution: Found potentially dangerous file");
|
||||
}
|
||||
|
||||
if (files.Any(file => FileExtensions.ExecutableExtensions.Contains(Path.GetExtension(file))))
|
||||
{
|
||||
return RejectionResult(ImportRejectionReason.ExecutableFile, "Caution: Found executable file");
|
||||
|
||||
Reference in New Issue
Block a user