Fixed: Don't process files that don't have a supported media file extension
This commit is contained in:
parent
d0efdc6c62
commit
1977f4aa3c
|
@ -5,6 +5,7 @@ using System.Linq;
|
|||
using NLog;
|
||||
using NzbDrone.Common.Disk;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.DecisionEngine;
|
||||
using NzbDrone.Core.Download;
|
||||
using NzbDrone.Core.MediaFiles.EpisodeImport;
|
||||
|
@ -243,6 +244,20 @@ namespace NzbDrone.Core.MediaFiles
|
|||
};
|
||||
}
|
||||
|
||||
var extension = Path.GetExtension(fileInfo.Name);
|
||||
|
||||
if (extension.IsNullOrWhiteSpace() || !MediaFileExtensions.Extensions.Contains(extension))
|
||||
{
|
||||
_logger.Debug("[{0}] has an unsupported extension: '{1}'", fileInfo.FullName, extension);
|
||||
|
||||
return new List<ImportResult>
|
||||
{
|
||||
new ImportResult(new ImportDecision(new LocalEpisode { Path = fileInfo.FullName },
|
||||
new Rejection($"Invalid video file, unsupported extension: '{extension}'")),
|
||||
$"Invalid video file, unsupported extension: '{extension}'")
|
||||
};
|
||||
}
|
||||
|
||||
if (downloadClientItem == null)
|
||||
{
|
||||
if (_diskProvider.IsFileLocked(fileInfo.FullName))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Core.Qualities;
|
||||
|
||||
|
|
Loading…
Reference in New Issue