aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Providers/DirectoryService.cs
diff options
context:
space:
mode:
authorLogicalPhallacy <44458166+LogicalPhallacy@users.noreply.github.com>2019-01-23 00:31:35 -0800
committerGitHub <noreply@github.com>2019-01-23 00:31:35 -0800
commit404bd04cbc17dc8c8bf4a5c9aa3ca9c5cd85aa68 (patch)
tree3d267c6ceef9439a034c113095e10e4d619e7c70 /MediaBrowser.Controller/Providers/DirectoryService.cs
parent8ff89fdc0c30f595a171ffc550f907ef22b6212a (diff)
parente05e002b8bb4d13eb2b80b56a0aad8903ddb701e (diff)
Merge pull request #8 from jellyfin/master
rebase to latest master
Diffstat (limited to 'MediaBrowser.Controller/Providers/DirectoryService.cs')
-rw-r--r--MediaBrowser.Controller/Providers/DirectoryService.cs12
1 files changed, 4 insertions, 8 deletions
diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.cs
index 9bb2f5bed..133e7c115 100644
--- a/MediaBrowser.Controller/Providers/DirectoryService.cs
+++ b/MediaBrowser.Controller/Providers/DirectoryService.cs
@@ -1,8 +1,8 @@
-using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Model.IO;
+using Microsoft.Extensions.Logging;
namespace MediaBrowser.Controller.Providers
{
@@ -25,9 +25,7 @@ namespace MediaBrowser.Controller.Providers
public FileSystemMetadata[] GetFileSystemEntries(string path)
{
- FileSystemMetadata[] entries;
-
- if (!_cache.TryGetValue(path, out entries))
+ if (!_cache.TryGetValue(path, out FileSystemMetadata[] entries))
{
//_logger.LogDebug("Getting files for " + path);
@@ -56,8 +54,7 @@ namespace MediaBrowser.Controller.Providers
public FileSystemMetadata GetFile(string path)
{
- FileSystemMetadata file;
- if (!_fileCache.TryGetValue(path, out file))
+ if (!_fileCache.TryGetValue(path, out FileSystemMetadata file))
{
file = _fileSystem.GetFileInfo(path);
@@ -83,8 +80,7 @@ namespace MediaBrowser.Controller.Providers
public List<string> GetFilePaths(string path, bool clearCache)
{
- List<string> result;
- if (clearCache || !_filePathCache.TryGetValue(path, out result))
+ if (clearCache || !_filePathCache.TryGetValue(path, out List<string> result))
{
result = _fileSystem.GetFilePaths(path).ToList();