diff options
| author | Bond-009 <bond.009@outlook.com> | 2025-09-12 21:58:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-12 13:58:02 -0600 |
| commit | deee04ae38cf057938f37c1dd7a98d20cf5b65f3 (patch) | |
| tree | eff7d6326c9d1edadd8230771e12886edb0cf925 | |
| parent | 580db0c1d232343adcabcf35c3b5889fbd875d8b (diff) | |
Add fast path to check for empty ignore files (#14782)
| -rw-r--r-- | Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs b/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs index 401ca73b8..bafe3ad43 100644 --- a/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs +++ b/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs @@ -50,6 +50,13 @@ public class DotIgnoreIgnoreRule : IResolverIgnoreRule return false; } + // Fast path in case the ignore files isn't a symlink and is empty + if ((dirIgnoreFile.Attributes & FileAttributes.ReparsePoint) == 0 + && dirIgnoreFile.Length == 0) + { + return true; + } + // ignore the directory only if the .ignore file is empty // evaluate individual files otherwise return string.IsNullOrWhiteSpace(GetFileContent(dirIgnoreFile)); |
