diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2019-07-02 11:56:13 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-02 11:56:13 -0700 |
| commit | e722801f801bfcb7395d3cd394bdc99258edbf3b (patch) | |
| tree | 4cdfa6f1c6917dee0abd3743f53dccd39f17d14e /Emby.Server.Implementations/ApplicationHost.cs | |
| parent | 6cf9204219616d76798685c3a44661619f68a82e (diff) | |
| parent | 29ae7b9aeb46ac297ba5c3253d73cd4cd325c042 (diff) | |
Merge pull request #956 from Bond-009/db
Simplify db code
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 62cc6ec47..3aa2dbf9a 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -754,10 +754,6 @@ namespace Emby.Server.Implementations UserDataManager = new UserDataManager(LoggerFactory, ServerConfigurationManager, () => UserManager); serviceCollection.AddSingleton(UserDataManager); - UserRepository = GetUserRepository(); - // This is only needed for disposal purposes. If removing this, make sure to have the manager handle disposing it - serviceCollection.AddSingleton(UserRepository); - var displayPreferencesRepo = new SqliteDisplayPreferencesRepository(LoggerFactory, JsonSerializer, ApplicationPaths, FileSystemManager); serviceCollection.AddSingleton<IDisplayPreferencesRepository>(displayPreferencesRepo); @@ -767,6 +763,8 @@ namespace Emby.Server.Implementations AuthenticationRepository = GetAuthenticationRepository(); serviceCollection.AddSingleton(AuthenticationRepository); + UserRepository = GetUserRepository(); + UserManager = new UserManager(LoggerFactory, ServerConfigurationManager, UserRepository, XmlSerializer, NetworkManager, () => ImageProcessor, () => DtoService, this, JsonSerializer, FileSystemManager); serviceCollection.AddSingleton(UserManager); @@ -807,7 +805,6 @@ namespace Emby.Server.Implementations serviceCollection.AddSingleton(TVSeriesManager); DeviceManager = new DeviceManager(AuthenticationRepository, JsonSerializer, LibraryManager, LocalizationManager, UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager); - serviceCollection.AddSingleton(DeviceManager); MediaSourceManager = new MediaSourceManager(ItemRepository, ApplicationPaths, LocalizationManager, UserManager, LibraryManager, LoggerFactory, JsonSerializer, FileSystemManager, UserDataManager, () => MediaEncoder); @@ -1893,8 +1890,12 @@ namespace Emby.Server.Implementations Logger.LogError(ex, "Error disposing {Type}", part.GetType().Name); } } + + UserRepository.Dispose(); } + UserRepository = null; + _disposed = true; } } |
