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>
This commit is contained in:
CBPJ 2025-11-17 14:09:07 -05:00 committed by Bond_009
parent 4e68a5a078
commit a08b6ac266

View File

@ -1,5 +1,6 @@
using System; using System;
using System.IO; using System.IO;
using System.Runtime.InteropServices;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.IO; using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Resolvers; using MediaBrowser.Controller.Resolvers;
@ -88,6 +89,13 @@ public class DotIgnoreIgnoreRule : IResolverIgnoreRule
var ignore = new Ignore.Ignore(); var ignore = new Ignore.Ignore();
ignore.Add(ignoreRules); 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); return ignore.IsIgnored(fileInfo.FullName);
} }