mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
Fixed: Don't process files that don't have a supported media file extension (#2938)
* Fixed: Don't process files that don't have a supported media file extension (cherry picked from commit 1977f4aa3c55cc0a06e1958e611f366d56cc346e) * fixup! * fixup! Co-authored-by: Mark McDowall <mark@mcdowall.ca> Co-authored-by: Qstick <qstick@gmail.com>
This commit is contained in:
parent
b3b93db643
commit
d27d982120
1 changed files with 15 additions and 0 deletions
|
@ -6,6 +6,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.Events;
|
||||
|
@ -276,6 +277,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<LocalTrack>(new LocalTrack { Path = fileInfo.FullName },
|
||||
new Rejection($"Invalid audio file, unsupported extension: '{extension}'")),
|
||||
$"Invalid audio file, unsupported extension: '{extension}'")
|
||||
};
|
||||
}
|
||||
|
||||
if (downloadClientItem == null)
|
||||
{
|
||||
if (_diskProvider.IsFileLocked(fileInfo.FullName))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue