mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-06 14:32:56 +01:00
Add hidden file check in bdInfo (#15582)
This commit is contained in:
parent
94f3725208
commit
29b3aa8543
1 changed files with 7 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using BDInfo.IO;
|
||||
|
|
@ -58,6 +59,8 @@ public class BdInfoDirectoryInfo : IDirectoryInfo
|
|||
}
|
||||
}
|
||||
|
||||
private static bool IsHidden(ReadOnlySpan<char> name) => name.StartsWith('.');
|
||||
|
||||
/// <summary>
|
||||
/// Gets the directories.
|
||||
/// </summary>
|
||||
|
|
@ -65,6 +68,7 @@ public class BdInfoDirectoryInfo : IDirectoryInfo
|
|||
public IDirectoryInfo[] GetDirectories()
|
||||
{
|
||||
return _fileSystem.GetDirectories(_impl.FullName)
|
||||
.Where(d => !IsHidden(d.Name))
|
||||
.Select(x => new BdInfoDirectoryInfo(_fileSystem, x))
|
||||
.ToArray();
|
||||
}
|
||||
|
|
@ -76,6 +80,7 @@ public class BdInfoDirectoryInfo : IDirectoryInfo
|
|||
public IFileInfo[] GetFiles()
|
||||
{
|
||||
return _fileSystem.GetFiles(_impl.FullName)
|
||||
.Where(d => !IsHidden(d.Name))
|
||||
.Select(x => new BdInfoFileInfo(x))
|
||||
.ToArray();
|
||||
}
|
||||
|
|
@ -88,6 +93,7 @@ public class BdInfoDirectoryInfo : IDirectoryInfo
|
|||
public IFileInfo[] GetFiles(string searchPattern)
|
||||
{
|
||||
return _fileSystem.GetFiles(_impl.FullName, new[] { searchPattern }, false, false)
|
||||
.Where(d => !IsHidden(d.Name))
|
||||
.Select(x => new BdInfoFileInfo(x))
|
||||
.ToArray();
|
||||
}
|
||||
|
|
@ -105,6 +111,7 @@ public class BdInfoDirectoryInfo : IDirectoryInfo
|
|||
new[] { searchPattern },
|
||||
false,
|
||||
searchOption == SearchOption.AllDirectories)
|
||||
.Where(d => !IsHidden(d.Name))
|
||||
.Select(x => new BdInfoFileInfo(x))
|
||||
.ToArray();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue