mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 14:03:03 +03:00
add more methods to file system interface
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Resolvers;
|
||||
using System;
|
||||
@@ -30,6 +31,13 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
|
||||
}.ToDictionary(i => i, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
private readonly IFileSystem _fileSystem;
|
||||
|
||||
public CoreResolutionIgnoreRule(IFileSystem fileSystem)
|
||||
{
|
||||
_fileSystem = fileSystem;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shoulds the ignore.
|
||||
/// </summary>
|
||||
@@ -60,23 +68,12 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
return false;
|
||||
}
|
||||
|
||||
// Drives will sometimes be hidden
|
||||
if (args.Path.EndsWith(Path.VolumeSeparatorChar + "\\", StringComparison.OrdinalIgnoreCase))
|
||||
// Sometimes these are marked hidden
|
||||
if (_fileSystem.IsRootPath(args.Path))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Shares will sometimes be hidden
|
||||
if (args.Path.StartsWith("\\", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// Look for a share, e.g. \\server\movies
|
||||
// Is there a better way to detect if a path is a share without using native code?
|
||||
if (args.Path.Substring(2).Split(Path.DirectorySeparatorChar).Length == 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user