< Summary - Jellyfin

Information
Class: Emby.Server.Implementations.Library.IgnorePatterns
Assembly: Emby.Server.Implementations
File(s): /srv/git/jellyfin/Emby.Server.Implementations/Library/IgnorePatterns.cs
Line coverage
100%
Covered lines: 119
Uncovered lines: 0
Coverable lines: 119
Total lines: 150
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 12/27/2025 - 12:11:51 AM Line coverage: 100% (101/101) Branch coverage: 100% (4/4) Total lines: 1321/19/2026 - 12:13:54 AM Line coverage: 100% (102/102) Branch coverage: 100% (4/4) Total lines: 1331/29/2026 - 12:13:32 AM Line coverage: 100% (105/105) Branch coverage: 100% (4/4) Total lines: 1363/30/2026 - 12:14:34 AM Line coverage: 100% (119/119) Branch coverage: 100% (4/4) Total lines: 150 12/27/2025 - 12:11:51 AM Line coverage: 100% (101/101) Branch coverage: 100% (4/4) Total lines: 1321/19/2026 - 12:13:54 AM Line coverage: 100% (102/102) Branch coverage: 100% (4/4) Total lines: 1331/29/2026 - 12:13:32 AM Line coverage: 100% (105/105) Branch coverage: 100% (4/4) Total lines: 1363/30/2026 - 12:14:34 AM Line coverage: 100% (119/119) Branch coverage: 100% (4/4) Total lines: 150

Coverage delta

Coverage delta 1 -1

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.cctor()100%11100%
ShouldIgnore(...)100%44100%

File(s)

/srv/git/jellyfin/Emby.Server.Implementations/Library/IgnorePatterns.cs

#LineLine coverage
 1using System;
 2using DotNet.Globbing;
 3
 4namespace Emby.Server.Implementations.Library
 5{
 6    /// <summary>
 7    /// Glob patterns for files to ignore.
 8    /// </summary>
 9    public static class IgnorePatterns
 10    {
 11        /// <summary>
 12        /// Files matching these glob patterns will be ignored.
 13        /// </summary>
 114        private static readonly string[] _patterns =
 115        {
 116            "**/small.jpg",
 117            "**/albumart.jpg",
 118
 119            // We have neither non-greedy matching or character group repetitions, working around that here.
 120            // https://github.com/dazinator/DotNet.Glob#patterns
 121            // .*/sample\..{1,5}
 122            "**/sample.?",
 123            "**/sample.??",
 124            "**/sample.???", // Matches sample.mkv
 125            "**/sample.????", // Matches sample.webm
 126            "**/sample.?????",
 127            "**/*.sample.?",
 128            "**/*.sample.??",
 129            "**/*.sample.???",
 130            "**/*.sample.????",
 131            "**/*.sample.?????",
 132            "**/sample/*",
 133
 134            // Avoid adding Hungarian sample files
 135            // https://github.com/jellyfin/jellyfin/issues/16237
 136            "**/minta.?",
 137            "**/minta.??",
 138            "**/minta.???", // Matches minta.mkv
 139            "**/minta.????", // Matches minta.webm
 140            "**/minta.?????",
 141            "**/*.minta.?",
 142            "**/*.minta.??",
 143            "**/*.minta.???",
 144            "**/*.minta.????",
 145            "**/*.minta.?????",
 146            "**/minta/*",
 147
 148            // Directories
 149            "**/metadata/**",
 150            "**/metadata",
 151            "**/ps3_update/**",
 152            "**/ps3_update",
 153            "**/ps3_vprm/**",
 154            "**/ps3_vprm",
 155            "**/extrafanart/**",
 156            "**/extrafanart",
 157            "**/extrathumbs/**",
 158            "**/extrathumbs",
 159            "**/.actors/**",
 160            "**/.actors",
 161            "**/.wd_tv/**",
 162            "**/.wd_tv",
 163            "**/lost+found/**",
 164            "**/lost+found",
 165            "**/subs/**",
 166            "**/subs",
 167            "**/.snapshots/**",
 168            "**/.snapshots",
 169            "**/.snapshot/**",
 170            "**/.snapshot",
 171
 172            // Trickplay files
 173            "**/*.trickplay",
 174            "**/*.trickplay/**",
 175
 176            // WMC temp recording directories that will constantly be written to
 177            "**/TempRec/**",
 178            "**/TempRec",
 179            "**/TempSBE/**",
 180            "**/TempSBE",
 181
 182            // Synology
 183            "**/eaDir/**",
 184            "**/eaDir",
 185            "**/@eaDir/**",
 186            "**/@eaDir",
 187            "**/#recycle/**",
 188            "**/#recycle",
 189
 190            // Qnap
 191            "**/@Recycle/**",
 192            "**/@Recycle",
 193            "**/.@__thumb/**",
 194            "**/.@__thumb",
 195            "**/$RECYCLE.BIN/**",
 196            "**/$RECYCLE.BIN",
 197            "**/System Volume Information/**",
 198            "**/System Volume Information",
 199            "**/.grab/**",
 1100            "**/.grab",
 1101
 1102            // Unix hidden files
 1103            "**/.*",
 1104
 1105            // Mac - if you ever remove the above.
 1106            // "**/._*",
 1107            // "**/.DS_Store",
 1108
 1109            // thumbs.db
 1110            "**/thumbs.db",
 1111
 1112            // bts sync files
 1113            "**/*.bts",
 1114            "**/*.sync",
 1115
 1116            // zfs
 1117            "**/.zfs/**",
 1118            "**/.zfs"
 1119        };
 120
 1121        private static readonly GlobOptions _globOptions = new GlobOptions
 1122        {
 1123            Evaluation =
 1124            {
 1125                CaseInsensitive = true
 1126            }
 1127        };
 128
 1129        private static readonly Glob[] _globs = Array.ConvertAll(_patterns, p => Glob.Parse(p, _globOptions));
 130
 131        /// <summary>
 132        /// Returns true if the supplied path should be ignored.
 133        /// </summary>
 134        /// <param name="path">The path to test.</param>
 135        /// <returns>Whether to ignore the path.</returns>
 136        public static bool ShouldIgnore(ReadOnlySpan<char> path)
 137        {
 37138            int len = _globs.Length;
 4376139            for (int i = 0; i < len; i++)
 140            {
 2170141                if (_globs[i].IsMatch(path))
 142                {
 19143                    return true;
 144                }
 145            }
 146
 18147            return false;
 148        }
 149    }
 150}