From 1a1cfba795689f5c74fac9cd88d75074c657276c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 20 Jul 2013 10:57:48 -0400 Subject: faster file extension comparisons --- .../Library/CoreResolutionIgnoreRule.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs') diff --git a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs index ebb79e96b..f6e5af7b5 100644 --- a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs +++ b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs @@ -1,7 +1,6 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Resolvers; -using MediaBrowser.Model.Logging; using System; using System.Collections.Generic; using System.IO; @@ -14,12 +13,10 @@ namespace MediaBrowser.Server.Implementations.Library /// public class CoreResolutionIgnoreRule : IResolverIgnoreRule { - private readonly ILogger _logger; - /// /// Any folder named in this list will be ignored - can be added to at runtime for extensibility /// - private static readonly List IgnoreFolders = new List + private static readonly Dictionary IgnoreFolders = new List { "metadata", "certificate", @@ -28,12 +25,8 @@ namespace MediaBrowser.Server.Implementations.Library "ps3_vprm", "adv_obj", "extrafanart" - }; - public CoreResolutionIgnoreRule(ILogger logger) - { - _logger = logger; - } + }.ToDictionary(i => i, StringComparer.OrdinalIgnoreCase); /// /// Shoulds the ignore. @@ -81,7 +74,7 @@ namespace MediaBrowser.Server.Implementations.Library var filename = args.FileInfo.Name; // Ignore any folders in our list - if (IgnoreFolders.Contains(filename, StringComparer.OrdinalIgnoreCase)) + if (IgnoreFolders.ContainsKey(filename)) { return true; } -- cgit v1.2.3