The Free Software Media System - Server Backend & API
Add fast path to check for empty ignore files (#14782)
Bond-009deee04ae38cf
diff --git a/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs b/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.csindex 401ca73b80..bafe3ad436 100644--- a/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs+++ b/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs@@ -50,6 +50,13 @@ public class DotIgnoreIgnoreRule : IResolverIgnoreRulereturn 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 otherwisereturn string.IsNullOrWhiteSpace(GetFileContent(dirIgnoreFile));