diff options
| author | David Ullmer <daullmer@gmail.com> | 2020-08-31 16:16:01 +0200 |
|---|---|---|
| committer | David Ullmer <daullmer@gmail.com> | 2020-08-31 16:16:01 +0200 |
| commit | b7c07f682152529a9993cd0fb9760ab668d4c930 (patch) | |
| tree | a40f59efb5e6e612df47673359c1d20c72a78101 /Jellyfin.Server/CoreAppHost.cs | |
| parent | 9165dc3b3a94714da307079413f62326d5e585ef (diff) | |
| parent | 4cc7406fe92b468f8a4257d7c40bf1e28f2a3404 (diff) | |
Merge branch 'master' into library-pictures
Diffstat (limited to 'Jellyfin.Server/CoreAppHost.cs')
| -rw-r--r-- | Jellyfin.Server/CoreAppHost.cs | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/Jellyfin.Server/CoreAppHost.cs b/Jellyfin.Server/CoreAppHost.cs index 29a59e1c8..755844dd9 100644 --- a/Jellyfin.Server/CoreAppHost.cs +++ b/Jellyfin.Server/CoreAppHost.cs @@ -1,20 +1,20 @@ using System; using System.Collections.Generic; -using System.IO; using System.Reflection; using Emby.Drawing; using Emby.Server.Implementations; using Jellyfin.Drawing.Skia; using Jellyfin.Server.Implementations; using Jellyfin.Server.Implementations.Activity; +using Jellyfin.Server.Implementations.Events; using Jellyfin.Server.Implementations.Users; using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Controller.Drawing; +using MediaBrowser.Controller.Events; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Activity; using MediaBrowser.Model.IO; -using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -33,30 +33,33 @@ namespace Jellyfin.Server /// <param name="options">The <see cref="StartupOptions" /> to be used by the <see cref="CoreAppHost" />.</param> /// <param name="fileSystem">The <see cref="IFileSystem" /> to be used by the <see cref="CoreAppHost" />.</param> /// <param name="networkManager">The <see cref="INetworkManager" /> to be used by the <see cref="CoreAppHost" />.</param> + /// <param name="collection">The <see cref="IServiceCollection"/> to be used by the <see cref="CoreAppHost"/>.</param> public CoreAppHost( IServerApplicationPaths applicationPaths, ILoggerFactory loggerFactory, IStartupOptions options, IFileSystem fileSystem, - INetworkManager networkManager) + INetworkManager networkManager, + IServiceCollection collection) : base( applicationPaths, loggerFactory, options, fileSystem, - networkManager) + networkManager, + collection) { } /// <inheritdoc/> - protected override void RegisterServices(IServiceCollection serviceCollection) + protected override void RegisterServices() { // Register an image encoder bool useSkiaEncoder = SkiaEncoder.IsNativeLibAvailable(); Type imageEncoderType = useSkiaEncoder ? typeof(SkiaEncoder) : typeof(NullImageEncoder); - serviceCollection.AddSingleton(typeof(IImageEncoder), imageEncoderType); + ServiceCollection.AddSingleton(typeof(IImageEncoder), imageEncoderType); // Log a warning if the Skia encoder could not be used if (!useSkiaEncoder) @@ -71,13 +74,15 @@ namespace Jellyfin.Server // .UseSqlite($"Filename={Path.Combine(ApplicationPaths.DataPath, "jellyfin.db")}"), // ServiceLifetime.Transient); - serviceCollection.AddSingleton<JellyfinDbProvider>(); + ServiceCollection.AddEventServices(); + ServiceCollection.AddSingleton<IEventManager, EventManager>(); + ServiceCollection.AddSingleton<JellyfinDbProvider>(); - serviceCollection.AddSingleton<IActivityManager, ActivityManager>(); - serviceCollection.AddSingleton<IUserManager, UserManager>(); - serviceCollection.AddSingleton<IDisplayPreferencesManager, DisplayPreferencesManager>(); + ServiceCollection.AddSingleton<IActivityManager, ActivityManager>(); + ServiceCollection.AddSingleton<IUserManager, UserManager>(); + ServiceCollection.AddSingleton<IDisplayPreferencesManager, DisplayPreferencesManager>(); - base.RegisterServices(serviceCollection); + base.RegisterServices(); } /// <inheritdoc /> |
