mirror of https://github.com/Sonarr/Sonarr
New: Do not import files inside the EXTRAS folder within a Series
This commit is contained in:
parent
017b6ade5e
commit
859e36aa6b
|
@ -1,4 +1,6 @@
|
||||||
using System.Diagnostics;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
@ -76,7 +78,7 @@ namespace NzbDrone.Core.MediaFiles
|
||||||
}
|
}
|
||||||
|
|
||||||
var videoFilesStopwatch = Stopwatch.StartNew();
|
var videoFilesStopwatch = Stopwatch.StartNew();
|
||||||
var mediaFileList = GetVideoFiles(series.Path).ToList();
|
var mediaFileList = GetVideoFiles(series.Path).Where(file => !file.StartsWith(Path.Combine(series.Path, "EXTRAS"))).ToList();
|
||||||
videoFilesStopwatch.Stop();
|
videoFilesStopwatch.Stop();
|
||||||
_logger.Trace("Finished getting episode files for: {0} [{1}]", series, videoFilesStopwatch.Elapsed);
|
_logger.Trace("Finished getting episode files for: {0} [{1}]", series, videoFilesStopwatch.Elapsed);
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,10 @@ namespace NzbDrone.Core.Metadata
|
||||||
_logger.Debug("Looking for existing metadata in {0}", message.Series.Path);
|
_logger.Debug("Looking for existing metadata in {0}", message.Series.Path);
|
||||||
|
|
||||||
var filesOnDisk = _diskProvider.GetFiles(message.Series.Path, SearchOption.AllDirectories);
|
var filesOnDisk = _diskProvider.GetFiles(message.Series.Path, SearchOption.AllDirectories);
|
||||||
var possibleMetadataFiles = filesOnDisk.Where(c => !MediaFileExtensions.Extensions.Contains(Path.GetExtension(c).ToLower())).ToList();
|
|
||||||
|
var possibleMetadataFiles = filesOnDisk.Where(c => !MediaFileExtensions.Extensions.Contains(Path.GetExtension(c).ToLower()) &&
|
||||||
|
!c.StartsWith(Path.Combine(message.Series.Path, "EXTRAS"))).ToList();
|
||||||
|
|
||||||
var filteredFiles = _metadataFileService.FilterExistingFiles(possibleMetadataFiles, message.Series);
|
var filteredFiles = _metadataFileService.FilterExistingFiles(possibleMetadataFiles, message.Series);
|
||||||
|
|
||||||
var metadataFiles = new List<MetadataFile>();
|
var metadataFiles = new List<MetadataFile>();
|
||||||
|
|
Loading…
Reference in New Issue