mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-06 17:55:38 +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.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using BDInfo.IO;
|
using BDInfo.IO;
|
||||||
|
|
@ -58,6 +59,8 @@ public class BdInfoDirectoryInfo : IDirectoryInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool IsHidden(ReadOnlySpan<char> name) => name.StartsWith('.');
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the directories.
|
/// Gets the directories.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -65,6 +68,7 @@ public class BdInfoDirectoryInfo : IDirectoryInfo
|
||||||
public IDirectoryInfo[] GetDirectories()
|
public IDirectoryInfo[] GetDirectories()
|
||||||
{
|
{
|
||||||
return _fileSystem.GetDirectories(_impl.FullName)
|
return _fileSystem.GetDirectories(_impl.FullName)
|
||||||
|
.Where(d => !IsHidden(d.Name))
|
||||||
.Select(x => new BdInfoDirectoryInfo(_fileSystem, x))
|
.Select(x => new BdInfoDirectoryInfo(_fileSystem, x))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
@ -76,6 +80,7 @@ public class BdInfoDirectoryInfo : IDirectoryInfo
|
||||||
public IFileInfo[] GetFiles()
|
public IFileInfo[] GetFiles()
|
||||||
{
|
{
|
||||||
return _fileSystem.GetFiles(_impl.FullName)
|
return _fileSystem.GetFiles(_impl.FullName)
|
||||||
|
.Where(d => !IsHidden(d.Name))
|
||||||
.Select(x => new BdInfoFileInfo(x))
|
.Select(x => new BdInfoFileInfo(x))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
@ -88,6 +93,7 @@ public class BdInfoDirectoryInfo : IDirectoryInfo
|
||||||
public IFileInfo[] GetFiles(string searchPattern)
|
public IFileInfo[] GetFiles(string searchPattern)
|
||||||
{
|
{
|
||||||
return _fileSystem.GetFiles(_impl.FullName, new[] { searchPattern }, false, false)
|
return _fileSystem.GetFiles(_impl.FullName, new[] { searchPattern }, false, false)
|
||||||
|
.Where(d => !IsHidden(d.Name))
|
||||||
.Select(x => new BdInfoFileInfo(x))
|
.Select(x => new BdInfoFileInfo(x))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
@ -105,6 +111,7 @@ public class BdInfoDirectoryInfo : IDirectoryInfo
|
||||||
new[] { searchPattern },
|
new[] { searchPattern },
|
||||||
false,
|
false,
|
||||||
searchOption == SearchOption.AllDirectories)
|
searchOption == SearchOption.AllDirectories)
|
||||||
|
.Where(d => !IsHidden(d.Name))
|
||||||
.Select(x => new BdInfoFileInfo(x))
|
.Select(x => new BdInfoFileInfo(x))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue