diff options
| author | Anthony Lavado <anthony@lavado.ca> | 2020-09-03 15:23:49 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-03 15:23:49 -0400 |
| commit | f02bcd9cf8cd1ff347f5fe3a91e2ec187e9dbd49 (patch) | |
| tree | c97b2b255d1d2d266939e28b41c12b1cc3bad08f /Jellyfin.Server/CoreAppHost.cs | |
| parent | 53703566b5e1239bbab308031d94df34a4d168aa (diff) | |
| parent | d81430270732591a5a66c9656bf841f46bed6f49 (diff) | |
Merge pull request #3849 from barronpm/scoped-displaypreferences
Make DisplayPreferencesManager Scoped
Diffstat (limited to 'Jellyfin.Server/CoreAppHost.cs')
| -rw-r--r-- | Jellyfin.Server/CoreAppHost.cs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Jellyfin.Server/CoreAppHost.cs b/Jellyfin.Server/CoreAppHost.cs index 755844dd9..8d569a779 100644 --- a/Jellyfin.Server/CoreAppHost.cs +++ b/Jellyfin.Server/CoreAppHost.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Reflection; using Emby.Drawing; using Emby.Server.Implementations; @@ -15,6 +16,7 @@ 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; @@ -67,12 +69,8 @@ namespace Jellyfin.Server Logger.LogWarning($"Skia not available. Will fallback to {nameof(NullImageEncoder)}."); } - // TODO: Set up scoping and use AddDbContextPool, - // can't register as Transient since tracking transient in GC is funky - // serviceCollection.AddDbContext<JellyfinDb>( - // options => options - // .UseSqlite($"Filename={Path.Combine(ApplicationPaths.DataPath, "jellyfin.db")}"), - // ServiceLifetime.Transient); + ServiceCollection.AddDbContextPool<JellyfinDb>( + options => options.UseSqlite($"Filename={Path.Combine(ApplicationPaths.DataPath, "jellyfin.db")}")); ServiceCollection.AddEventServices(); ServiceCollection.AddSingleton<IEventManager, EventManager>(); |
