@ -72,20 +72,24 @@ namespace NzbDrone.Core.MediaFiles
{
{
if ( _diskProvider . FolderExists ( path ) )
if ( _diskProvider . FolderExists ( path ) )
{
{
var directoryInfo = new DirectoryInfo ( path ) ;
if ( series = = null )
if ( series = = null )
{
{
return ProcessFolder ( new DirectoryInfo ( path ) , downloadClientItem ) ;
return ProcessFolder ( directoryInfo , downloadClientItem ) ;
}
}
return ProcessFolder ( new DirectoryInfo ( path ) , series , downloadClientItem ) ;
return ProcessFolder ( directoryInfo , series , downloadClientItem ) ;
}
}
var fileInfo = new FileInfo ( path ) ;
if ( series = = null )
if ( series = = null )
{
{
return ProcessFile ( new FileInfo ( path ) , downloadClientItem ) ;
return ProcessFile ( fileInfo , downloadClientItem ) ;
}
}
return ProcessFile ( new FileInfo ( path ) , series , downloadClientItem ) ;
return ProcessFile ( fileInfo , series , downloadClientItem ) ;
}
}
private List < ImportResult > ProcessFolder ( DirectoryInfo directoryInfo , DownloadClientItem downloadClientItem = null )
private List < ImportResult > ProcessFolder ( DirectoryInfo directoryInfo , DownloadClientItem downloadClientItem = null )
@ -120,7 +124,7 @@ namespace NzbDrone.Core.MediaFiles
if ( folderInfo ! = null )
if ( folderInfo ! = null )
{
{
_logger . Debug ( "{0} folder quality: {1}" , cleanedUpName , folderInfo . Quality ) ;
_logger . Debug ( "{0} folder quality: {1}" , cleanedUpName , folderInfo . Quality ) ;
}
}
var videoFiles = _diskScanService . GetVideoFiles ( directoryInfo . FullName ) ;
var videoFiles = _diskScanService . GetVideoFiles ( directoryInfo . FullName ) ;
@ -181,8 +185,7 @@ namespace NzbDrone.Core.MediaFiles
}
}
}
}
var folderInfo = Parser . Parser . ParseTitle ( fileInfo . DirectoryName ) ;
var decisions = _importDecisionMaker . GetImportDecisions ( new List < string > ( ) { fileInfo . FullName } , series , null , true ) ;
var decisions = _importDecisionMaker . GetImportDecisions ( new List < string > ( ) { fileInfo . FullName } , series , folderInfo , true ) ;
return _importApprovedEpisodes . Import ( decisions , true , downloadClientItem ) ;
return _importApprovedEpisodes . Import ( decisions , true , downloadClientItem ) ;
}
}