diff options
Diffstat (limited to 'Emby.Server.Implementations/IO')
8 files changed, 25 insertions, 36 deletions
diff --git a/Emby.Server.Implementations/IO/ExtendedFileSystemInfo.cs b/Emby.Server.Implementations/IO/ExtendedFileSystemInfo.cs index 6b08c26c9..48b34a3a0 100644 --- a/Emby.Server.Implementations/IO/ExtendedFileSystemInfo.cs +++ b/Emby.Server.Implementations/IO/ExtendedFileSystemInfo.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Text; - namespace Emby.Server.Implementations.IO { public class ExtendedFileSystemInfo diff --git a/Emby.Server.Implementations/IO/FileRefresher.cs b/Emby.Server.Implementations/IO/FileRefresher.cs index c2def33db..6bee178ea 100644 --- a/Emby.Server.Implementations/IO/FileRefresher.cs +++ b/Emby.Server.Implementations/IO/FileRefresher.cs @@ -1,16 +1,16 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; -using MediaBrowser.Model.IO; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Extensions; -using Microsoft.Extensions.Logging; +using MediaBrowser.Model.IO; using MediaBrowser.Model.System; using MediaBrowser.Model.Tasks; using MediaBrowser.Model.Threading; +using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.IO { diff --git a/Emby.Server.Implementations/IO/IsoManager.cs b/Emby.Server.Implementations/IO/IsoManager.cs index e0cf32868..f0a15097c 100644 --- a/Emby.Server.Implementations/IO/IsoManager.cs +++ b/Emby.Server.Implementations/IO/IsoManager.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading; @@ -23,8 +23,8 @@ namespace Emby.Server.Implementations.IO /// <param name="isoPath">The iso path.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>IsoMount.</returns> - /// <exception cref="System.ArgumentNullException">isoPath</exception> - /// <exception cref="System.ArgumentException"></exception> + /// <exception cref="ArgumentNullException">isoPath</exception> + /// <exception cref="ArgumentException"></exception> public Task<IIsoMount> Mount(string isoPath, CancellationToken cancellationToken) { if (string.IsNullOrEmpty(isoPath)) diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.cs index 9a224bd0e..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 { @@ -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) { @@ -263,7 +262,7 @@ 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)) @@ -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> diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.cs index bee96c785..ae1470190 100644 --- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs +++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs @@ -5,8 +5,8 @@ using System.IO; using System.Linq; using System.Text; using MediaBrowser.Model.IO; -using Microsoft.Extensions.Logging; using MediaBrowser.Model.System; +using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.IO { @@ -101,7 +101,7 @@ namespace Emby.Server.Implementations.IO /// </summary> /// <param name="filename">The filename.</param> /// <returns><c>true</c> if the specified filename is shortcut; otherwise, <c>false</c>.</returns> - /// <exception cref="System.ArgumentNullException">filename</exception> + /// <exception cref="ArgumentNullException">filename</exception> public virtual bool IsShortcut(string filename) { if (string.IsNullOrEmpty(filename)) @@ -118,7 +118,7 @@ namespace Emby.Server.Implementations.IO /// </summary> /// <param name="filename">The filename.</param> /// <returns>System.String.</returns> - /// <exception cref="System.ArgumentNullException">filename</exception> + /// <exception cref="ArgumentNullException">filename</exception> public virtual string ResolveShortcut(string filename) { if (string.IsNullOrEmpty(filename)) @@ -185,7 +185,7 @@ namespace Emby.Server.Implementations.IO /// </summary> /// <param name="shortcutPath">The shortcut path.</param> /// <param name="target">The target.</param> - /// <exception cref="System.ArgumentNullException"> + /// <exception cref="ArgumentNullException"> /// shortcutPath /// or /// target @@ -344,7 +344,7 @@ namespace Emby.Server.Implementations.IO /// </summary> /// <param name="filename">The filename.</param> /// <returns>System.String.</returns> - /// <exception cref="System.ArgumentNullException">filename</exception> + /// <exception cref="ArgumentNullException">filename</exception> public string GetValidFilename(string filename) { var builder = new StringBuilder(filename); @@ -526,7 +526,7 @@ namespace Emby.Server.Implementations.IO } else { - FileAttributes attributes = File.GetAttributes(path); + var attributes = File.GetAttributes(path); attributes = RemoveAttribute(attributes, FileAttributes.Hidden); File.SetAttributes(path, attributes); } @@ -550,7 +550,7 @@ namespace Emby.Server.Implementations.IO } else { - FileAttributes attributes = File.GetAttributes(path); + var attributes = File.GetAttributes(path); attributes = RemoveAttribute(attributes, FileAttributes.ReadOnly); File.SetAttributes(path, attributes); } diff --git a/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs b/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs index 8ac662f78..a306f94b3 100644 --- a/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs +++ b/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs @@ -1,7 +1,5 @@ -using System; +using System; using System.IO; - -using MediaBrowser.Controller.IO; using MediaBrowser.Model.IO; namespace Emby.Server.Implementations.IO diff --git a/Emby.Server.Implementations/IO/StreamHelper.cs b/Emby.Server.Implementations/IO/StreamHelper.cs index e91817611..09cf4d4a3 100644 --- a/Emby.Server.Implementations/IO/StreamHelper.cs +++ b/Emby.Server.Implementations/IO/StreamHelper.cs @@ -1,6 +1,6 @@ -using System.IO; -using System.Threading; using System; +using System.IO; +using System.Threading; using System.Threading.Tasks; using MediaBrowser.Model.IO; diff --git a/Emby.Server.Implementations/IO/ThrottledStream.cs b/Emby.Server.Implementations/IO/ThrottledStream.cs index 3635ee1db..81e8abc98 100644 --- a/Emby.Server.Implementations/IO/ThrottledStream.cs +++ b/Emby.Server.Implementations/IO/ThrottledStream.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Threading; using System.Threading.Tasks; @@ -264,7 +264,7 @@ namespace Emby.Server.Implementations.IO { if (!ThrottleCheck(bufferSizeInBytes)) { - return ; + return; } _byteCount += bufferSizeInBytes; @@ -352,4 +352,4 @@ namespace Emby.Server.Implementations.IO } #endregion } -}
\ No newline at end of file +} |
