< Summary - Jellyfin

Information
Class: Jellyfin.Server.Implementations.Events.EventingServiceCollectionExtensions
Assembly: Jellyfin.Server.Implementations
File(s): /srv/git/jellyfin/Jellyfin.Server.Implementations/Events/EventingServiceCollectionExtensions.cs
Line coverage
100%
Covered lines: 27
Uncovered lines: 0
Coverable lines: 27
Total lines: 72
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
AddEventServices(...)100%11100%

File(s)

/srv/git/jellyfin/Jellyfin.Server.Implementations/Events/EventingServiceCollectionExtensions.cs

#LineLine coverage
 1using Jellyfin.Data.Events.System;
 2using Jellyfin.Data.Events.Users;
 3using Jellyfin.Server.Implementations.Events.Consumers.Library;
 4using Jellyfin.Server.Implementations.Events.Consumers.Security;
 5using Jellyfin.Server.Implementations.Events.Consumers.Session;
 6using Jellyfin.Server.Implementations.Events.Consumers.System;
 7using Jellyfin.Server.Implementations.Events.Consumers.Updates;
 8using Jellyfin.Server.Implementations.Events.Consumers.Users;
 9using MediaBrowser.Common.Updates;
 10using MediaBrowser.Controller.Events;
 11using MediaBrowser.Controller.Events.Authentication;
 12using MediaBrowser.Controller.Events.Session;
 13using MediaBrowser.Controller.Events.Updates;
 14using MediaBrowser.Controller.Library;
 15using MediaBrowser.Controller.Lyrics;
 16using MediaBrowser.Controller.Subtitles;
 17using MediaBrowser.Model.Tasks;
 18using Microsoft.Extensions.DependencyInjection;
 19
 20namespace Jellyfin.Server.Implementations.Events
 21{
 22    /// <summary>
 23    /// A class containing extensions to <see cref="IServiceCollection"/> for eventing.
 24    /// </summary>
 25    public static class EventingServiceCollectionExtensions
 26    {
 27        /// <summary>
 28        /// Adds the event services to the service collection.
 29        /// </summary>
 30        /// <param name="collection">The service collection.</param>
 31        public static void AddEventServices(this IServiceCollection collection)
 32        {
 33            // Library consumers
 2234            collection.AddScoped<IEventConsumer<LyricDownloadFailureEventArgs>, LyricDownloadFailureLogger>();
 2235            collection.AddScoped<IEventConsumer<SubtitleDownloadFailureEventArgs>, SubtitleDownloadFailureLogger>();
 36
 37            // Security consumers
 2238            collection.AddScoped<IEventConsumer<AuthenticationRequestEventArgs>, AuthenticationFailedLogger>();
 2239            collection.AddScoped<IEventConsumer<AuthenticationResultEventArgs>, AuthenticationSucceededLogger>();
 40
 41            // Session consumers
 2242            collection.AddScoped<IEventConsumer<PlaybackStartEventArgs>, PlaybackStartLogger>();
 2243            collection.AddScoped<IEventConsumer<PlaybackStopEventArgs>, PlaybackStopLogger>();
 2244            collection.AddScoped<IEventConsumer<SessionEndedEventArgs>, SessionEndedLogger>();
 2245            collection.AddScoped<IEventConsumer<SessionStartedEventArgs>, SessionStartedLogger>();
 46
 47            // System consumers
 2248            collection.AddScoped<IEventConsumer<PendingRestartEventArgs>, PendingRestartNotifier>();
 2249            collection.AddScoped<IEventConsumer<TaskCompletionEventArgs>, TaskCompletedLogger>();
 2250            collection.AddScoped<IEventConsumer<TaskCompletionEventArgs>, TaskCompletedNotifier>();
 51
 52            // Update consumers
 2253            collection.AddScoped<IEventConsumer<PluginInstallationCancelledEventArgs>, PluginInstallationCancelledNotifi
 2254            collection.AddScoped<IEventConsumer<InstallationFailedEventArgs>, PluginInstallationFailedLogger>();
 2255            collection.AddScoped<IEventConsumer<InstallationFailedEventArgs>, PluginInstallationFailedNotifier>();
 2256            collection.AddScoped<IEventConsumer<PluginInstalledEventArgs>, PluginInstalledLogger>();
 2257            collection.AddScoped<IEventConsumer<PluginInstalledEventArgs>, PluginInstalledNotifier>();
 2258            collection.AddScoped<IEventConsumer<PluginInstallingEventArgs>, PluginInstallingNotifier>();
 2259            collection.AddScoped<IEventConsumer<PluginUninstalledEventArgs>, PluginUninstalledLogger>();
 2260            collection.AddScoped<IEventConsumer<PluginUninstalledEventArgs>, PluginUninstalledNotifier>();
 2261            collection.AddScoped<IEventConsumer<PluginUpdatedEventArgs>, PluginUpdatedLogger>();
 62
 63            // User consumers
 2264            collection.AddScoped<IEventConsumer<UserCreatedEventArgs>, UserCreatedLogger>();
 2265            collection.AddScoped<IEventConsumer<UserDeletedEventArgs>, UserDeletedLogger>();
 2266            collection.AddScoped<IEventConsumer<UserDeletedEventArgs>, UserDeletedNotifier>();
 2267            collection.AddScoped<IEventConsumer<UserLockedOutEventArgs>, UserLockedOutLogger>();
 2268            collection.AddScoped<IEventConsumer<UserPasswordChangedEventArgs>, UserPasswordChangedLogger>();
 2269            collection.AddScoped<IEventConsumer<UserUpdatedEventArgs>, UserUpdatedNotifier>();
 2270        }
 71    }
 72}