diff options
| author | Bond-009 <bond.009@outlook.com> | 2020-06-27 11:18:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-27 11:18:56 +0200 |
| commit | 71cbd516632b63cb278b45de259d37b1cc158449 (patch) | |
| tree | 926b71aed406cc8155dc6d1acb2140af068ed9ac /Emby.Server.Implementations | |
| parent | 9a44e2912eb09bd1c19b7aa65403a59eee107c0b (diff) | |
| parent | 9772749d8fa2c86089ff1e3e0b8443633193106a (diff) | |
Merge pull request #3456 from crobibero/ignore-patterns
Add more ignorepatterns and tests
Diffstat (limited to 'Emby.Server.Implementations')
| -rw-r--r-- | Emby.Server.Implementations/Library/IgnorePatterns.cs | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Library/IgnorePatterns.cs b/Emby.Server.Implementations/Library/IgnorePatterns.cs index 8c4098948..cd5c5f19d 100644 --- a/Emby.Server.Implementations/Library/IgnorePatterns.cs +++ b/Emby.Server.Implementations/Library/IgnorePatterns.cs @@ -11,7 +11,7 @@ namespace Emby.Server.Implementations.Library /// <summary> /// Files matching these glob patterns will be ignored. /// </summary> - public static readonly string[] Patterns = new string[] + private static readonly string[] _patterns = { "**/small.jpg", "**/albumart.jpg", @@ -19,32 +19,51 @@ namespace Emby.Server.Implementations.Library // Directories "**/metadata/**", + "**/metadata", "**/ps3_update/**", + "**/ps3_update", "**/ps3_vprm/**", + "**/ps3_vprm", "**/extrafanart/**", + "**/extrafanart", "**/extrathumbs/**", + "**/extrathumbs", "**/.actors/**", + "**/.actors", "**/.wd_tv/**", + "**/.wd_tv", "**/lost+found/**", + "**/lost+found", // WMC temp recording directories that will constantly be written to "**/TempRec/**", + "**/TempRec", "**/TempSBE/**", + "**/TempSBE", // Synology "**/eaDir/**", + "**/eaDir", "**/@eaDir/**", + "**/@eaDir", "**/#recycle/**", + "**/#recycle", // Qnap "**/@Recycle/**", + "**/@Recycle", "**/.@__thumb/**", + "**/.@__thumb", "**/$RECYCLE.BIN/**", + "**/$RECYCLE.BIN", "**/System Volume Information/**", + "**/System Volume Information", "**/.grab/**", + "**/.grab", // Unix hidden files and directories "**/.*/**", + "**/.*", // thumbs.db "**/thumbs.db", @@ -56,16 +75,19 @@ namespace Emby.Server.Implementations.Library private static readonly GlobOptions _globOptions = new GlobOptions { - Evaluation = { + Evaluation = + { CaseInsensitive = true } }; - private static readonly Glob[] _globs = Patterns.Select(p => Glob.Parse(p, _globOptions)).ToArray(); + private static readonly Glob[] _globs = _patterns.Select(p => Glob.Parse(p, _globOptions)).ToArray(); /// <summary> /// Returns true if the supplied path should be ignored. /// </summary> + /// <param name="path">The path to test.</param> + /// <returns>Whether to ignore the path.</returns> public static bool ShouldIgnore(string path) { return _globs.Any(g => g.IsMatch(path)); |
