aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs31
1 files changed, 21 insertions, 10 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs
index 7b58dd7c4..1628ccc32 100644
--- a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs
+++ b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs
@@ -15,10 +15,27 @@ namespace MediaBrowser.Server.Implementations.Library
public class CoreResolutionIgnoreRule : IResolverIgnoreRule
{
private readonly IFileSystem _fileSystem;
+ private readonly ILibraryManager _libraryManager;
- public CoreResolutionIgnoreRule(IFileSystem fileSystem)
+ /// <summary>
+ /// Any folder named in this list will be ignored - can be added to at runtime for extensibility
+ /// </summary>
+ public static readonly List<string> IgnoreFolders = new List<string>
+ {
+ "metadata",
+ "ps3_update",
+ "ps3_vprm",
+ "extrafanart",
+ "extrathumbs",
+ ".actors",
+ ".wd_tv"
+
+ };
+
+ public CoreResolutionIgnoreRule(IFileSystem fileSystem, ILibraryManager libraryManager)
{
_fileSystem = fileSystem;
+ _libraryManager = libraryManager;
}
/// <summary>
@@ -63,7 +80,7 @@ namespace MediaBrowser.Server.Implementations.Library
if (args.IsDirectory)
{
// Ignore any folders in our list
- if (EntityResolutionHelper.IgnoreFolders.Contains(filename, StringComparer.OrdinalIgnoreCase))
+ if (IgnoreFolders.Contains(filename, StringComparer.OrdinalIgnoreCase))
{
return true;
}
@@ -90,18 +107,12 @@ namespace MediaBrowser.Server.Implementations.Library
if (args.Parent != null)
{
// Don't resolve these into audio files
- if (string.Equals(_fileSystem.GetFileNameWithoutExtension(filename), BaseItem.ThemeSongFilename) && EntityResolutionHelper.IsAudioFile(filename))
- {
- return true;
- }
-
- // Don't misidentify xbmc trailers as a movie
- if (filename.IndexOf(BaseItem.XbmcTrailerFileSuffix, StringComparison.OrdinalIgnoreCase) != -1)
+ if (string.Equals(_fileSystem.GetFileNameWithoutExtension(filename), BaseItem.ThemeSongFilename) && _libraryManager.IsAudioFile(filename))
{
return true;
}
}
-
+
// Ignore samples
if (filename.IndexOf(".sample.", StringComparison.OrdinalIgnoreCase) != -1)
{