parent
365c6a7741
commit
481345226a
|
@ -31,7 +31,6 @@ namespace NzbDrone.Core.Extras
|
||||||
public void Handle(SeriesScannedEvent message)
|
public void Handle(SeriesScannedEvent message)
|
||||||
{
|
{
|
||||||
var series = message.Series;
|
var series = message.Series;
|
||||||
var extraFiles = new List<ExtraFile>();
|
|
||||||
|
|
||||||
if (!_diskProvider.FolderExists(series.Path))
|
if (!_diskProvider.FolderExists(series.Path))
|
||||||
{
|
{
|
||||||
|
@ -41,19 +40,18 @@ namespace NzbDrone.Core.Extras
|
||||||
_logger.Debug("Looking for existing extra files in {0}", series.Path);
|
_logger.Debug("Looking for existing extra files in {0}", series.Path);
|
||||||
|
|
||||||
var filesOnDisk = _diskScanService.GetNonVideoFiles(series.Path);
|
var filesOnDisk = _diskScanService.GetNonVideoFiles(series.Path);
|
||||||
var possibleExtraFiles = _diskScanService.FilterPaths(series.Path, filesOnDisk, false);
|
var possibleExtraFiles = _diskScanService.FilterPaths(series.Path, filesOnDisk);
|
||||||
|
|
||||||
var filteredFiles = possibleExtraFiles;
|
|
||||||
var importedFiles = new List<string>();
|
var importedFiles = new List<string>();
|
||||||
|
|
||||||
foreach (var existingExtraFileImporter in _existingExtraFileImporters)
|
foreach (var existingExtraFileImporter in _existingExtraFileImporters)
|
||||||
{
|
{
|
||||||
var imported = existingExtraFileImporter.ProcessFiles(series, filteredFiles, importedFiles);
|
var imported = existingExtraFileImporter.ProcessFiles(series, possibleExtraFiles, importedFiles);
|
||||||
|
|
||||||
importedFiles.AddRange(imported.Select(f => Path.Combine(series.Path, f.RelativePath)));
|
importedFiles.AddRange(imported.Select(f => Path.Combine(series.Path, f.RelativePath)));
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Info("Found {0} extra files", extraFiles.Count);
|
_logger.Info("Found {0} possible extra files, imported {1} files.", possibleExtraFiles.Count, importedFiles.Count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue