1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

Fixed: Don't scan subfolders in series folders that start with a period

This commit is contained in:
Mark McDowall 2015-01-26 22:29:18 -08:00
parent 0d3c467c50
commit 6054dd8ee6
2 changed files with 20 additions and 1 deletions

View File

@ -143,5 +143,24 @@ public void should_scan_extras_series_and_subfolders()
Mocker.GetMock<IMakeImportDecision>()
.Verify(v => v.GetImportDecisions(It.Is<List<string>>(l => l.Count == 4), _series, false, (QualityModel)null), Times.Once());
}
[Test]
public void should_not_scan_subfolders_that_start_with_period()
{
GivenParentFolderExists();
GivenFiles(new List<string>
{
Path.Combine(_series.Path, ".@__thumb", "file1.mkv").AsOsAgnostic(),
Path.Combine(_series.Path, ".@__THUMB", "file2.mkv").AsOsAgnostic(),
Path.Combine(_series.Path, ".hidden", "file2.mkv").AsOsAgnostic(),
Path.Combine(_series.Path, "Season 1", "s01e01.mkv").AsOsAgnostic()
});
Subject.Scan(_series);
Mocker.GetMock<IMakeImportDecision>()
.Verify(v => v.GetImportDecisions(It.Is<List<string>>(l => l.Count == 1), _series, false, (QualityModel)null), Times.Once());
}
}
}

View File

@ -57,7 +57,7 @@ public DiskScanService(IDiskProvider diskProvider,
_logger = logger;
}
private static readonly Regex ExcludedSubFoldersRegex = new Regex(@"(extras|\.appledouble)(?:\\|\/)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex ExcludedSubFoldersRegex = new Regex(@"(extras|^\..+)(?:\\|\/)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
public void Scan(Series series)
{