From 79cff81ffde5977f4e78521bd86f7c1bc8c07a47 Mon Sep 17 00:00:00 2001 From: Qstick Date: Fri, 2 Oct 2020 22:14:08 -0400 Subject: [PATCH] Rename FilterFiles to FilterPaths Signed-off-by: Robin Dadswell --- .../DownloadClientTests/Blackhole/ScanWatchFolderFixture.cs | 2 +- .../Blackhole/TorrentBlackholeFixture.cs | 2 +- .../DownloadClientTests/Blackhole/UsenetBlackholeFixture.cs | 2 +- .../DiskScanProviderTests/GetAudioFilesFixture.cs | 2 +- .../Download/Clients/Blackhole/ScanWatchFolder.cs | 2 +- src/NzbDrone.Core/MediaFiles/DiskScanService.cs | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/ScanWatchFolderFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/ScanWatchFolderFixture.cs index dcd7fdf19..0c184d349 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/ScanWatchFolderFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/ScanWatchFolderFixture.cs @@ -37,7 +37,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.Blackhole .Setup(c => c.GetFileSize(It.IsAny())) .Returns(1000000); - Mocker.GetMock().Setup(c => c.FilterFiles(It.IsAny(), It.IsAny>())) + Mocker.GetMock().Setup(c => c.FilterPaths(It.IsAny(), It.IsAny>())) .Returns>((b, s) => s.ToList()); Mocker.GetMock().Setup(c => c.FilterFiles(It.IsAny(), It.IsAny>())) diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/TorrentBlackholeFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/TorrentBlackholeFixture.cs index c075fab69..e6feccb78 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/TorrentBlackholeFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/TorrentBlackholeFixture.cs @@ -51,7 +51,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.Blackhole .Setup(c => c.GetHashFromTorrentFile(It.IsAny())) .Returns("myhash"); - Mocker.GetMock().Setup(c => c.FilterFiles(It.IsAny(), It.IsAny>())) + Mocker.GetMock().Setup(c => c.FilterPaths(It.IsAny(), It.IsAny>())) .Returns>((b, s) => s.ToList()); Mocker.GetMock().Setup(c => c.FilterFiles(It.IsAny(), It.IsAny>())) diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/UsenetBlackholeFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/UsenetBlackholeFixture.cs index 8f10eae5e..165f906a1 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/UsenetBlackholeFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/UsenetBlackholeFixture.cs @@ -43,7 +43,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.Blackhole .Setup(c => c.OpenWriteStream(It.IsAny())) .Returns(() => new FileStream(GetTempFilePath(), FileMode.Create)); - Mocker.GetMock().Setup(c => c.FilterFiles(It.IsAny(), It.IsAny>())) + Mocker.GetMock().Setup(c => c.FilterPaths(It.IsAny(), It.IsAny>())) .Returns>((b, s) => s.ToList()); Mocker.GetMock().Setup(c => c.FilterFiles(It.IsAny(), It.IsAny>())) diff --git a/src/NzbDrone.Core.Test/ProviderTests/DiskScanProviderTests/GetAudioFilesFixture.cs b/src/NzbDrone.Core.Test/ProviderTests/DiskScanProviderTests/GetAudioFilesFixture.cs index e4682b411..719eb3544 100644 --- a/src/NzbDrone.Core.Test/ProviderTests/DiskScanProviderTests/GetAudioFilesFixture.cs +++ b/src/NzbDrone.Core.Test/ProviderTests/DiskScanProviderTests/GetAudioFilesFixture.cs @@ -103,7 +103,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DiskScanProviderTests var specialFiles = GetFiles(_path, subFolder).ToList(); var allFiles = files.Concat(specialFiles); - var filteredFiles = Subject.FilterFiles(_path, allFiles); + var filteredFiles = Subject.FilterPaths(_path, allFiles); filteredFiles.Should().NotContain(specialFiles); filteredFiles.Count.Should().BeGreaterThan(0); } diff --git a/src/NzbDrone.Core/Download/Clients/Blackhole/ScanWatchFolder.cs b/src/NzbDrone.Core/Download/Clients/Blackhole/ScanWatchFolder.cs index df04053fe..c8de4e510 100644 --- a/src/NzbDrone.Core/Download/Clients/Blackhole/ScanWatchFolder.cs +++ b/src/NzbDrone.Core/Download/Clients/Blackhole/ScanWatchFolder.cs @@ -50,7 +50,7 @@ namespace NzbDrone.Core.Download.Clients.Blackhole private IEnumerable GetDownloadItems(string watchFolder, Dictionary lastWatchItems, TimeSpan waitPeriod) { - foreach (var folder in _diskScanService.FilterFiles(watchFolder, _diskProvider.GetDirectories(watchFolder))) + foreach (var folder in _diskScanService.FilterPaths(watchFolder, _diskProvider.GetDirectories(watchFolder))) { var title = FileNameBuilder.CleanFileName(Path.GetFileName(folder)); diff --git a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs index 29ab0b780..55364231c 100644 --- a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs +++ b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs @@ -29,7 +29,7 @@ namespace NzbDrone.Core.MediaFiles IFileInfo[] GetBookFiles(string path, bool allDirectories = true); string[] GetNonBookFiles(string path, bool allDirectories = true); List FilterFiles(string basePath, IEnumerable files); - List FilterFiles(string basePath, IEnumerable files); + List FilterPaths(string basePath, IEnumerable paths); } public class DiskScanService : @@ -287,9 +287,9 @@ namespace NzbDrone.Core.MediaFiles return mediaFileList.ToArray(); } - public List FilterFiles(string basePath, IEnumerable files) + public List FilterPaths(string basePath, IEnumerable paths) { - return files.Where(file => !ExcludedSubFoldersRegex.IsMatch(basePath.GetRelativePath(file))) + return paths.Where(file => !ExcludedSubFoldersRegex.IsMatch(basePath.GetRelativePath(file))) .Where(file => !ExcludedFilesRegex.IsMatch(Path.GetFileName(file))) .ToList(); }