aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs
diff options
context:
space:
mode:
authorLogan Douglas <42654828+JadedRain@users.noreply.github.com>2025-10-31 13:06:17 -0600
committerGitHub <noreply@github.com>2025-10-31 13:06:17 -0600
commit490bf347cbdf8ec458996d09ba40651eb647b7b9 (patch)
tree1bdad774667bf5e69f3fe7397a27f631a5ca617a /Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs
parentfd6e48603bcf143a1bbc3b1bda26a8e1664f9379 (diff)
parent23929a3e709f4324d49271c02b0b047e1149e860 (diff)
Merge branch 'jellyfin:master' into master
Diffstat (limited to 'Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs')
-rw-r--r--Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs b/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs
index bafe3ad436..959acd4751 100644
--- a/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs
+++ b/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs
@@ -51,8 +51,7 @@ public class DotIgnoreIgnoreRule : IResolverIgnoreRule
}
// Fast path in case the ignore files isn't a symlink and is empty
- if ((dirIgnoreFile.Attributes & FileAttributes.ReparsePoint) == 0
- && dirIgnoreFile.Length == 0)
+ if (dirIgnoreFile.LinkTarget is null && dirIgnoreFile.Length == 0)
{
return true;
}
@@ -93,6 +92,12 @@ public class DotIgnoreIgnoreRule : IResolverIgnoreRule
private static string GetFileContent(FileInfo dirIgnoreFile)
{
+ dirIgnoreFile = (FileInfo?)dirIgnoreFile.ResolveLinkTarget(returnFinalTarget: true) ?? dirIgnoreFile;
+ if (!dirIgnoreFile.Exists)
+ {
+ return string.Empty;
+ }
+
using (var reader = dirIgnoreFile.OpenText())
{
return reader.ReadToEnd();