1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-24 11:43:07 +01:00

Fixed: Skip extras in 'Extras' subfolder

Closes #4980
This commit is contained in:
Mark McDowall 2022-04-11 18:18:02 -07:00
parent 365c6a7741
commit 481345226a

View File

@ -31,7 +31,6 @@ namespace NzbDrone.Core.Extras
public void Handle(SeriesScannedEvent message)
{
var series = message.Series;
var extraFiles = new List<ExtraFile>();
if (!_diskProvider.FolderExists(series.Path))
{
@ -41,19 +40,18 @@ namespace NzbDrone.Core.Extras
_logger.Debug("Looking for existing extra files in {0}", 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>();
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)));
}
_logger.Info("Found {0} extra files", extraFiles.Count);
_logger.Info("Found {0} possible extra files, imported {1} files.", possibleExtraFiles.Count, importedFiles.Count);
}
}
}