From 78e00578c20d0127b540bc69290972104f12ac84 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 3 Oct 2023 10:25:14 -0400 Subject: Use DI for IFileSystem --- Emby.Server.Implementations/IO/ManagedFileSystem.cs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'Emby.Server.Implementations/IO/ManagedFileSystem.cs') diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.cs index 3aa5233ed..18b00ce0b 100644 --- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs +++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs @@ -15,10 +15,6 @@ namespace Emby.Server.Implementations.IO /// public class ManagedFileSystem : IFileSystem { - private readonly ILogger _logger; - - private readonly List _shortcutHandlers = new List(); - private readonly string _tempPath; private static readonly bool _isEnvironmentCaseInsensitive = OperatingSystem.IsWindows(); private static readonly char[] _invalidPathCharacters = { @@ -29,23 +25,24 @@ namespace Emby.Server.Implementations.IO (char)31, ':', '*', '?', '\\', '/' }; + private readonly ILogger _logger; + private readonly List _shortcutHandlers; + private readonly string _tempPath; + /// /// Initializes a new instance of the class. /// /// The instance to use. /// The instance to use. + /// the 's to use. public ManagedFileSystem( ILogger logger, - IApplicationPaths applicationPaths) + IApplicationPaths applicationPaths, + IEnumerable shortcutHandlers) { _logger = logger; _tempPath = applicationPaths.TempDirectory; - } - - /// - public virtual void AddShortcutHandler(IShortcutHandler handler) - { - _shortcutHandlers.Add(handler); + _shortcutHandlers = shortcutHandlers.ToList(); } /// -- cgit v1.2.3