From 70c85925af31ee341f87fced39a67ab7fb4eed77 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Wed, 6 Feb 2019 21:31:41 +0100 Subject: Move some arrays to generics --- Emby.Server.Implementations/IO/LibraryMonitor.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Emby.Server.Implementations/IO/LibraryMonitor.cs') diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.cs index 11c684b12..607a4d333 100644 --- a/Emby.Server.Implementations/IO/LibraryMonitor.cs +++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs @@ -34,7 +34,7 @@ namespace Emby.Server.Implementations.IO /// /// Any file name ending in any of these will be ignored by the watchers /// - private readonly string[] _alwaysIgnoreFiles = new string[] + private readonly HashSet _alwaysIgnoreFiles = new HashSet(StringComparer.OrdinalIgnoreCase) { "small.jpg", "albumart.jpg", @@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.IO ".actors" }; - private readonly string[] _alwaysIgnoreExtensions = new string[] + private readonly HashSet _alwaysIgnoreExtensions = new HashSet(StringComparer.OrdinalIgnoreCase) { // thumbs.db ".db", @@ -456,8 +456,8 @@ namespace Emby.Server.Implementations.IO var filename = Path.GetFileName(path); var monitorPath = !string.IsNullOrEmpty(filename) && - !_alwaysIgnoreFiles.Contains(filename, StringComparer.OrdinalIgnoreCase) && - !_alwaysIgnoreExtensions.Contains(Path.GetExtension(path) ?? string.Empty, StringComparer.OrdinalIgnoreCase) && + !_alwaysIgnoreFiles.Contains(filename) && + !_alwaysIgnoreExtensions.Contains(Path.GetExtension(path)) && _alwaysIgnoreSubstrings.All(i => path.IndexOf(i, StringComparison.OrdinalIgnoreCase) == -1); // Ignore certain files -- cgit v1.2.3