From ac3a94f5a1dbb94b374e0160c344fcf99af9b696 Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Sun, 3 Mar 2013 01:58:04 -0500 Subject: moved resolvers to implementations, trimmed nuget package a bit --- .../Library/CoreResolutionIgnoreRule.cs | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs (limited to 'MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs') diff --git a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs new file mode 100644 index 000000000..98b8bea11 --- /dev/null +++ b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs @@ -0,0 +1,55 @@ +using MediaBrowser.Controller.Library; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace MediaBrowser.Server.Implementations.Library +{ + /// + /// Provides the core resolver ignore rules + /// + public class CoreResolutionIgnoreRule : IResolverIgnoreRule + { + /// + /// Any folder named in this list will be ignored - can be added to at runtime for extensibility + /// + private static readonly List IgnoreFolders = new List + { + "trailers", + "metadata", + "certificate", + "backup", + "ps3_update", + "ps3_vprm", + "adv_obj", + "extrafanart" + }; + + /// + /// Shoulds the ignore. + /// + /// The args. + /// true if XXXX, false otherwise + public bool ShouldIgnore(ItemResolveArgs args) + { + // Ignore hidden files and folders + if (args.IsHidden) + { + return true; + } + + if (args.IsDirectory) + { + var filename = args.FileInfo.cFileName; + + // Ignore any folders in our list + if (IgnoreFolders.Contains(filename, StringComparer.OrdinalIgnoreCase)) + { + return true; + } + } + + return false; + } + } +} -- cgit v1.2.3