The Free Software Media System - Server Backend & API
Fix warnings in IO
Patrick Barronc09ef74b516c
diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.csindex aa80bccd72..e9d069cd33 100644--- a/Emby.Server.Implementations/IO/LibraryMonitor.cs+++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs@@ -41,6 +41,25 @@ namespace Emby.Server.Implementations.IOprivate bool _disposed = false;+ /// <summary>+ /// Initializes a new instance of the <see cref="LibraryMonitor" /> class.+ /// </summary>+ /// <param name="logger">The logger.</param>+ /// <param name="libraryManager">The library manager.</param>+ /// <param name="configurationManager">The configuration manager.</param>+ /// <param name="fileSystem">The filesystem.</param>+ public LibraryMonitor(+ ILogger<LibraryMonitor> logger,+ ILibraryManager libraryManager,+ IServerConfigurationManager configurationManager,+ IFileSystem fileSystem)+ {+ _libraryManager = libraryManager;+ _logger = logger;+ _configurationManager = configurationManager;+ _fileSystem = fileSystem;+ }+/// <summary>/// Add the path to our temporary ignore list. Use when writing to a path within our listening scope./// </summary>@@ -95,21 +114,6 @@ namespace Emby.Server.Implementations.IO}}- /// <summary>- /// Initializes a new instance of the <see cref="LibraryMonitor" /> class.- /// </summary>- public LibraryMonitor(- ILogger<LibraryMonitor> logger,- ILibraryManager libraryManager,- IServerConfigurationManager configurationManager,- IFileSystem fileSystem)- {- _libraryManager = libraryManager;- _logger = logger;- _configurationManager = configurationManager;- _fileSystem = fileSystem;- }-private bool IsLibraryMonitorEnabled(BaseItem item){if (item is BasePluginFolder)@@ -199,7 +203,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="ArgumentNullException">path</exception>+ /// <exception cref="ArgumentNullException"><paramref name="path"/> is <c>null</c>.</exception>private static bool ContainsParentFolder(IEnumerable<string> lst, string path){if (string.IsNullOrEmpty(path))diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.csindex 77da46cd6d..eeee288425 100644--- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs+++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs@@ -17,7 +17,7 @@ namespace Emby.Server.Implementations.IO/// </summary>public class ManagedFileSystem : IFileSystem{- protected ILogger<ManagedFileSystem> Logger;+ private readonly ILogger<ManagedFileSystem> _logger;private readonly List<IShortcutHandler> _shortcutHandlers = new List<IShortcutHandler>();private readonly string _tempPath;@@ -27,7 +27,7 @@ namespace Emby.Server.Implementations.IOILogger<ManagedFileSystem> logger,IApplicationPaths applicationPaths){- Logger = logger;+ _logger = logger;_tempPath = applicationPaths.TempDirectory;}@@ -41,7 +41,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="ArgumentNullException">filename</exception>+ /// <exception cref="ArgumentNullException"><paramref name="filename"/> is <c>null</c>.</exception>public virtual bool IsShortcut(string filename){if (string.IsNullOrEmpty(filename))@@ -58,7 +58,7 @@ namespace Emby.Server.Implementations.IO/// </summary>/// <param name="filename">The filename.</param>/// <returns>System.String.</returns>- /// <exception cref="ArgumentNullException">filename</exception>+ /// <exception cref="ArgumentNullException"><paramref name="filename"/> is <c>null</c>.</exception>public virtual string? ResolveShortcut(string filename){if (string.IsNullOrEmpty(filename))@@ -233,9 +233,9 @@ namespace Emby.Server.Implementations.IOresult.IsDirectory = info is DirectoryInfo || (info.Attributes & FileAttributes.Directory) == FileAttributes.Directory;// if (!result.IsDirectory)- //{+ // {// result.IsHidden = (info.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden;- //}+ // }if (info is FileInfo fileInfo){@@ -254,7 +254,7 @@ namespace Emby.Server.Implementations.IOcatch (FileNotFoundException ex){// Dangling symlinks cannot be detected before opening the file unfortunately...- Logger.LogError(ex, "Reading the file size of the symlink at {Path} failed. Marking the file as not existing.", fileInfo.FullName);+ _logger.LogError(ex, "Reading the file size of the symlink at {Path} failed. Marking the file as not existing.", fileInfo.FullName);result.Exists = false;}}@@ -343,7 +343,7 @@ namespace Emby.Server.Implementations.IO}catch (Exception ex){- Logger.LogError(ex, "Error determining CreationTimeUtc for {FullName}", info.FullName);+ _logger.LogError(ex, "Error determining CreationTimeUtc for {FullName}", info.FullName);return DateTime.MinValue;}}@@ -382,7 +382,7 @@ namespace Emby.Server.Implementations.IO}catch (Exception ex){- Logger.LogError(ex, "Error determining LastAccessTimeUtc for {FullName}", info.FullName);+ _logger.LogError(ex, "Error determining LastAccessTimeUtc for {FullName}", info.FullName);return DateTime.MinValue;}}