mirror of https://github.com/Sonarr/Sonarr
Fixed: Don't scan subfolders in series folders that start with a period
This commit is contained in:
parent
0d3c467c50
commit
6054dd8ee6
|
@ -143,5 +143,24 @@ namespace NzbDrone.Core.Test.MediaFiles.DiskScanServiceTests
|
||||||
Mocker.GetMock<IMakeImportDecision>()
|
Mocker.GetMock<IMakeImportDecision>()
|
||||||
.Verify(v => v.GetImportDecisions(It.Is<List<string>>(l => l.Count == 4), _series, false, (QualityModel)null), Times.Once());
|
.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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace NzbDrone.Core.MediaFiles
|
||||||
_logger = logger;
|
_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)
|
public void Scan(Series series)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue