aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2023-11-15 19:48:50 -0500
committerPatrick Barron <barronpm@gmail.com>2023-11-15 19:48:50 -0500
commit7e645dcfc0809ed2bfa9d31235839bf649bc76d2 (patch)
treeaccbbbec654a930f555fd9e6afc465617f176bd3 /Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
parent8f5f0a0310ca7dd55b64623782c05bbb810f946f (diff)
Make ILibraryChangedNotifier sealed
Diffstat (limited to 'Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs')
-rw-r--r--Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs39
1 files changed, 12 insertions, 27 deletions
diff --git a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
index 4d5065b92..0df8c2a5a 100644
--- a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
@@ -25,7 +25,7 @@ using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.EntryPoints
{
- public class LibraryChangedNotifier : IServerEntryPoint
+ public sealed class LibraryChangedNotifier : IServerEntryPoint
{
private readonly ILibraryManager _libraryManager;
private readonly IServerConfigurationManager _configurationManager;
@@ -405,36 +405,21 @@ namespace Emby.Server.Implementations.EntryPoints
return Array.Empty<T>();
}
- /// <summary>
- /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
- /// </summary>
+ /// <inheritdoc />
public void Dispose()
{
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- /// <summary>
- /// Releases unmanaged and - optionally - managed resources.
- /// </summary>
- /// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
- protected virtual void Dispose(bool dispose)
- {
- if (dispose)
- {
- if (LibraryUpdateTimer is not null)
- {
- LibraryUpdateTimer.Dispose();
- LibraryUpdateTimer = null;
- }
+ _libraryManager.ItemAdded -= OnLibraryItemAdded;
+ _libraryManager.ItemUpdated -= OnLibraryItemUpdated;
+ _libraryManager.ItemRemoved -= OnLibraryItemRemoved;
- _libraryManager.ItemAdded -= OnLibraryItemAdded;
- _libraryManager.ItemUpdated -= OnLibraryItemUpdated;
- _libraryManager.ItemRemoved -= OnLibraryItemRemoved;
+ _providerManager.RefreshCompleted -= OnProviderRefreshCompleted;
+ _providerManager.RefreshStarted -= OnProviderRefreshStarted;
+ _providerManager.RefreshProgress -= OnProviderRefreshProgress;
- _providerManager.RefreshCompleted -= OnProviderRefreshCompleted;
- _providerManager.RefreshStarted -= OnProviderRefreshStarted;
- _providerManager.RefreshProgress -= OnProviderRefreshProgress;
+ if (LibraryUpdateTimer is not null)
+ {
+ LibraryUpdateTimer.Dispose();
+ LibraryUpdateTimer = null;
}
}
}