aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library
diff options
context:
space:
mode:
authorCBPJ <explr@qq.com>2025-11-17 14:09:07 -0500
committerBond_009 <bond.009@outlook.com>2025-11-17 14:09:07 -0500
commita08b6ac2664003cb89804ce192f9ae3f3acb4be9 (patch)
treeeeb0cb1649710262fc0bd6569f2176f2db2c5f34 /Emby.Server.Implementations/Library
parent4e68a5a078a7f1b5daf382354b83ae7a2657d1cb (diff)
Backport pull request #15487 from jellyfin/release-10.11.z
Fix gitignore-style not working properly on windows. Original-merge: 435bb14bb266916e9c6f100c4324a94c36126e06 Merged-by: crobibero <cody@robibe.ro> Backported-by: Bond_009 <bond.009@outlook.com>
Diffstat (limited to 'Emby.Server.Implementations/Library')
-rw-r--r--Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs b/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs
index e53502046..46e60dbaa 100644
--- a/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs
+++ b/Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs
@@ -1,5 +1,6 @@
using System;
using System.IO;
+using System.Runtime.InteropServices;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Resolvers;
@@ -88,6 +89,13 @@ public class DotIgnoreIgnoreRule : IResolverIgnoreRule
var ignore = new Ignore.Ignore();
ignore.Add(ignoreRules);
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ // Mitigate the problem of the Ignore library not handling Windows paths correctly.
+ // See https://github.com/jellyfin/jellyfin/issues/15484
+ return ignore.IsIgnored(fileInfo.FullName.NormalizePath('/'));
+ }
+
return ignore.IsIgnored(fileInfo.FullName);
}