|
@@ -61,10 +61,22 @@ namespace MediaBrowser.Controller.Providers
|
|
|
}
|
|
|
|
|
|
public FileSystemMetadata? GetFile(string path)
|
|
|
+ {
|
|
|
+ var entry = GetFileSystemEntry(path);
|
|
|
+ return entry != null && !entry.IsDirectory ? entry : null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public FileSystemMetadata? GetDirectory(string path)
|
|
|
+ {
|
|
|
+ var entry = GetFileSystemEntry(path);
|
|
|
+ return entry != null && entry.IsDirectory ? entry : null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public FileSystemMetadata? GetFileSystemEntry(string path)
|
|
|
{
|
|
|
if (!_fileCache.TryGetValue(path, out var result))
|
|
|
{
|
|
|
- var file = _fileSystem.GetFileInfo(path);
|
|
|
+ var file = _fileSystem.GetFileSystemInfo(path);
|
|
|
if (file.Exists)
|
|
|
{
|
|
|
result = file;
|