aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/IO/LibraryMonitor.cs
diff options
context:
space:
mode:
authorAndrew Rabert <6550543+nvllsvm@users.noreply.github.com>2019-01-22 18:13:47 -0500
committerGitHub <noreply@github.com>2019-01-22 18:13:47 -0500
commit28483bdb54be96ae83e0fded097f534d7e26ba1e (patch)
treee7f4b92326417ebf55eecdf68a01d2c3b9e660d7 /Emby.Server.Implementations/IO/LibraryMonitor.cs
parent920c39454c05e979eabe81877269cd4517a03ccf (diff)
parent8106c8393b711a7e1d40487e3caf2b014decbe28 (diff)
Merge pull request #651 from jellyfin/release-10.1.0
Release 10.1.0
Diffstat (limited to 'Emby.Server.Implementations/IO/LibraryMonitor.cs')
-rw-r--r--Emby.Server.Implementations/IO/LibraryMonitor.cs27
1 files changed, 11 insertions, 16 deletions
diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.cs
index ca5810fd6..6a3204011 100644
--- a/Emby.Server.Implementations/IO/LibraryMonitor.cs
+++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
@@ -9,10 +9,10 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.IO;
-using Microsoft.Extensions.Logging;
using MediaBrowser.Model.System;
using MediaBrowser.Model.Tasks;
using MediaBrowser.Model.Threading;
+using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.IO
{
@@ -77,7 +77,7 @@ namespace Emby.Server.Implementations.IO
{
if (string.IsNullOrEmpty(path))
{
- throw new ArgumentNullException("path");
+ throw new ArgumentNullException(nameof(path));
}
TemporarilyIgnore(path);
@@ -95,7 +95,7 @@ namespace Emby.Server.Implementations.IO
{
if (string.IsNullOrEmpty(path))
{
- throw new ArgumentNullException("path");
+ throw new ArgumentNullException(nameof(path));
}
// This is an arbitraty amount of time, but delay it because file system writes often trigger events long after the file was actually written to.
@@ -103,8 +103,7 @@ namespace Emby.Server.Implementations.IO
// But if we make this delay too high, we risk missing legitimate changes, such as user adding a new file, or hand-editing metadata
await Task.Delay(45000).ConfigureAwait(false);
- string val;
- _tempIgnoredPaths.TryRemove(path, out val);
+ _tempIgnoredPaths.TryRemove(path, out var val);
if (refreshPath)
{
@@ -145,7 +144,7 @@ namespace Emby.Server.Implementations.IO
{
if (taskManager == null)
{
- throw new ArgumentNullException("taskManager");
+ throw new ArgumentNullException(nameof(taskManager));
}
LibraryManager = libraryManager;
@@ -263,12 +262,12 @@ namespace Emby.Server.Implementations.IO
/// <param name="lst">The LST.</param>
/// <param name="path">The path.</param>
/// <returns><c>true</c> if [contains parent folder] [the specified LST]; otherwise, <c>false</c>.</returns>
- /// <exception cref="System.ArgumentNullException">path</exception>
+ /// <exception cref="ArgumentNullException">path</exception>
private static bool ContainsParentFolder(IEnumerable<string> lst, string path)
{
if (string.IsNullOrEmpty(path))
{
- throw new ArgumentNullException("path");
+ throw new ArgumentNullException(nameof(path));
}
path = path.TrimEnd(Path.DirectorySeparatorChar);
@@ -365,9 +364,7 @@ namespace Emby.Server.Implementations.IO
/// <param name="path">The path.</param>
private void StopWatchingPath(string path)
{
- FileSystemWatcher watcher;
-
- if (_fileSystemWatchers.TryGetValue(path, out watcher))
+ if (_fileSystemWatchers.TryGetValue(path, out var watcher))
{
DisposeWatcher(watcher, true);
}
@@ -424,9 +421,7 @@ namespace Emby.Server.Implementations.IO
/// <param name="watcher">The watcher.</param>
private void RemoveWatcherFromList(FileSystemWatcher watcher)
{
- FileSystemWatcher removed;
-
- _fileSystemWatchers.TryRemove(watcher.Path, out removed);
+ _fileSystemWatchers.TryRemove(watcher.Path, out var removed);
}
/// <summary>
@@ -469,7 +464,7 @@ namespace Emby.Server.Implementations.IO
{
if (string.IsNullOrEmpty(path))
{
- throw new ArgumentNullException("path");
+ throw new ArgumentNullException(nameof(path));
}
var filename = Path.GetFileName(path);