mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 04:22:30 +01:00
Fixed: Do not scan episode files in .AppleDouble folders
This commit is contained in:
parent
175ae3e996
commit
7af9748ff3
@ -66,6 +66,7 @@ public void should_not_scan_if_series_root_folder_does_not_exist()
|
||||
public void should_not_scan_extras_folder()
|
||||
{
|
||||
GivenParentFolderExists();
|
||||
|
||||
GivenFiles(new List<String>
|
||||
{
|
||||
Path.Combine(_series.Path, "EXTRAS", "file1.mkv").AsOsAgnostic(),
|
||||
@ -75,9 +76,23 @@ public void should_not_scan_extras_folder()
|
||||
Path.Combine(_series.Path, "Season 1", "s01e01.mkv").AsOsAgnostic()
|
||||
});
|
||||
|
||||
// Mocker.GetMock<IMakeImportDecision>()
|
||||
// .Setup(s => s.GetImportDecisions(It.IsAny<List<String>>(), _series, false, (QualityModel) null))
|
||||
// .Returns(new List<ImportDecision>());
|
||||
Subject.Scan(_series);
|
||||
|
||||
Mocker.GetMock<IMakeImportDecision>()
|
||||
.Verify(v => v.GetImportDecisions(It.Is<List<String>>(l => l.Count == 1), _series, false, (QualityModel)null), Times.Once());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_scan_AppleDouble_folder()
|
||||
{
|
||||
GivenParentFolderExists();
|
||||
|
||||
GivenFiles(new List<String>
|
||||
{
|
||||
Path.Combine(_series.Path, ".AppleDouble", "file1.mkv").AsOsAgnostic(),
|
||||
Path.Combine(_series.Path, ".appledouble", "file2.mkv").AsOsAgnostic(),
|
||||
Path.Combine(_series.Path, "Season 1", "s01e01.mkv").AsOsAgnostic()
|
||||
});
|
||||
|
||||
Subject.Scan(_series);
|
||||
|
||||
|
@ -56,7 +56,7 @@ public DiskScanService(IDiskProvider diskProvider,
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
private static readonly Regex ExtrasRegex = new Regex(@"(?:\\|\/)extras(?:\\|\/)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private static readonly Regex ExcludedSubFoldersRegex = new Regex(@"(?:\\|\/)(extras|\.appledouble)(?:\\|\/)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public void Scan(Series series)
|
||||
{
|
||||
@ -89,7 +89,7 @@ public void Scan(Series series)
|
||||
}
|
||||
|
||||
var videoFilesStopwatch = Stopwatch.StartNew();
|
||||
var mediaFileList = GetVideoFiles(series.Path).Where(file => !ExtrasRegex.IsMatch(file)).ToList();
|
||||
var mediaFileList = GetVideoFiles(series.Path).Where(file => !ExcludedSubFoldersRegex.IsMatch(file)).ToList();
|
||||
videoFilesStopwatch.Stop();
|
||||
_logger.Trace("Finished getting episode files for: {0} [{1}]", series, videoFilesStopwatch.Elapsed);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user