mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 18:08:53 -07:00
Merge pull request #1155 from arcticwaters/symlinks
Handle symlinks in library folders
This commit is contained in:
commit
8e4c9940ee
@ -221,7 +221,9 @@ namespace MediaBrowser.Api
|
||||
/// <returns>IEnumerable{FileSystemEntryInfo}.</returns>
|
||||
private IEnumerable<FileSystemEntryInfo> GetFileSystemEntries(GetDirectoryContents request)
|
||||
{
|
||||
var entries = new DirectoryInfo(request.Path).EnumerateFileSystemInfos().Where(i =>
|
||||
// using EnumerateFileSystemInfos doesn't handle reparse points (symlinks)
|
||||
var entries = new DirectoryInfo(request.Path).EnumerateDirectories("*", SearchOption.TopDirectoryOnly)
|
||||
.Concat<FileSystemInfo>(new DirectoryInfo(request.Path).EnumerateFiles("*", SearchOption.TopDirectoryOnly)).Where(i =>
|
||||
{
|
||||
if (!request.IncludeHidden && i.Attributes.HasFlag(FileAttributes.Hidden))
|
||||
{
|
||||
|
@ -58,8 +58,9 @@ namespace MediaBrowser.Controller.Providers
|
||||
|
||||
try
|
||||
{
|
||||
var list = new DirectoryInfo(path)
|
||||
.EnumerateFileSystemInfos("*", SearchOption.TopDirectoryOnly);
|
||||
// using EnumerateFileSystemInfos doesn't handle reparse points (symlinks)
|
||||
var list = new DirectoryInfo(path).EnumerateDirectories("*", SearchOption.TopDirectoryOnly)
|
||||
.Concat<FileSystemInfo>(new DirectoryInfo(path).EnumerateFiles("*", SearchOption.TopDirectoryOnly));
|
||||
|
||||
// Seeing dupes on some users file system for some reason
|
||||
foreach (var item in list)
|
||||
|
Loading…
Reference in New Issue
Block a user