diff --git a/Jellyfin.Plugin.PlaybackReporting/Data/IActivityRepository.cs b/Jellyfin.Plugin.PlaybackReporting/Data/IActivityRepository.cs index 0391c0a..425ad86 100644 --- a/Jellyfin.Plugin.PlaybackReporting/Data/IActivityRepository.cs +++ b/Jellyfin.Plugin.PlaybackReporting/Data/IActivityRepository.cs @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License namespace Jellyfin.Plugin.PlaybackReporting.Data { - public interface IActivityRepository + public interface IActivityRepository : IDisposable { int RemoveUnknownUsers(List known_user_ids); void ManageUserList(string action, string id); diff --git a/Jellyfin.Plugin.PlaybackReporting/EventMonitorEntryPoint.cs b/Jellyfin.Plugin.PlaybackReporting/EventMonitorEntryPoint.cs index a1014e6..b619a8f 100644 --- a/Jellyfin.Plugin.PlaybackReporting/EventMonitorEntryPoint.cs +++ b/Jellyfin.Plugin.PlaybackReporting/EventMonitorEntryPoint.cs @@ -34,7 +34,7 @@ You should have received a copy of the GNU General Public License namespace Jellyfin.Plugin.PlaybackReporting { - public class EventMonitorEntryPoint : IHostedService + public class EventMonitorEntryPoint : IHostedService, IDisposable { private readonly ISessionManager _sessionManager; private readonly IServerConfigurationManager _config; @@ -368,5 +368,19 @@ public Task StopAsync(CancellationToken cancellationToken) return Task.CompletedTask; } + + public void Dispose() + { + if (_repository != null) + { + _repository.Dispose(); + _repository = null; + } + } + + ~EventMonitorEntryPoint() + { + Dispose(); + } } } diff --git a/README.md b/README.md index 0a1ba59..4b1859e 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ This information can be viewed as a multitude of different graphs, and can also ## Build -1. To build this plugin you will need [.Net 5.x](https://dotnet.microsoft.com/download/dotnet/5.0). +1. To build this plugin you will need [.Net 8.x](https://dotnet.microsoft.com/download/dotnet/8.0). 2. Build plugin with following command ```