@ -6,6 +6,7 @@ using System.Linq;
using NLog ;
using NLog ;
using NzbDrone.Common.Disk ;
using NzbDrone.Common.Disk ;
using NzbDrone.Common.EnvironmentInfo ;
using NzbDrone.Common.EnvironmentInfo ;
using NzbDrone.Common.Extensions ;
using NzbDrone.Core.DecisionEngine ;
using NzbDrone.Core.DecisionEngine ;
using NzbDrone.Core.Download ;
using NzbDrone.Core.Download ;
using NzbDrone.Core.MediaFiles.Events ;
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 ( downloadClientItem = = null )
{
{
if ( _diskProvider . IsFileLocked ( fileInfo . FullName ) )
if ( _diskProvider . IsFileLocked ( fileInfo . FullName ) )