diff options
| author | Bond_009 <bond.009@outlook.com> | 2019-01-25 22:41:43 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2019-01-25 22:41:43 +0100 |
| commit | fd7f420af2a2983bc1982ab784b367b8e7604735 (patch) | |
| tree | d2c613d5019f9114fc2676cbf0297e2b217504c1 /Emby.Server.Implementations/IO/LibraryMonitor.cs | |
| parent | e0315b569591b71938829a8f35ac264399ef66bd (diff) | |
Remove remnants of system events
Diffstat (limited to 'Emby.Server.Implementations/IO/LibraryMonitor.cs')
| -rw-r--r-- | Emby.Server.Implementations/IO/LibraryMonitor.cs | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.cs index 6a3204011..204f9d949 100644 --- a/Emby.Server.Implementations/IO/LibraryMonitor.cs +++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs @@ -140,7 +140,14 @@ namespace Emby.Server.Implementations.IO /// <summary> /// Initializes a new instance of the <see cref="LibraryMonitor" /> class. /// </summary> - public LibraryMonitor(ILoggerFactory loggerFactory, ITaskManager taskManager, ILibraryManager libraryManager, IServerConfigurationManager configurationManager, IFileSystem fileSystem, ITimerFactory timerFactory, ISystemEvents systemEvents, IEnvironmentInfo environmentInfo) + public LibraryMonitor( + ILoggerFactory loggerFactory, + ITaskManager taskManager, + ILibraryManager libraryManager, + IServerConfigurationManager configurationManager, + IFileSystem fileSystem, + ITimerFactory timerFactory, + IEnvironmentInfo environmentInfo) { if (taskManager == null) { @@ -154,26 +161,9 @@ namespace Emby.Server.Implementations.IO _fileSystem = fileSystem; _timerFactory = timerFactory; _environmentInfo = environmentInfo; - - systemEvents.Resume += _systemEvents_Resume; - } - - private void _systemEvents_Resume(object sender, EventArgs e) - { - Restart(); - } - - private void Restart() - { - Stop(); - - if (!_disposed) - { - Start(); - } } - private bool IsLibraryMonitorEnabaled(BaseItem item) + private bool IsLibraryMonitorEnabled(BaseItem item) { if (item is BasePluginFolder) { @@ -200,7 +190,7 @@ namespace Emby.Server.Implementations.IO var paths = LibraryManager .RootFolder .Children - .Where(IsLibraryMonitorEnabaled) + .Where(IsLibraryMonitorEnabled) .OfType<Folder>() .SelectMany(f => f.PhysicalLocations) .Distinct(StringComparer.OrdinalIgnoreCase) @@ -223,7 +213,7 @@ namespace Emby.Server.Implementations.IO private void StartWatching(BaseItem item) { - if (IsLibraryMonitorEnabaled(item)) + if (IsLibraryMonitorEnabled(item)) { StartWatchingPath(item.Path); } |
