diff options
Diffstat (limited to 'MediaBrowser.Server.Startup.Common/ApplicationHost.cs')
| -rw-r--r-- | MediaBrowser.Server.Startup.Common/ApplicationHost.cs | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index e7e6a9dc3..ec1ccbff5 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -587,8 +587,11 @@ namespace MediaBrowser.Server.Startup.Common RegisterSingleInstance(SubtitleEncoder); await displayPreferencesRepo.Initialize().ConfigureAwait(false); - await ConfigureUserDataRepositories().ConfigureAwait(false); - await itemRepo.Initialize().ConfigureAwait(false); + + var userDataRepo = new SqliteUserDataRepository(LogManager, ApplicationPaths, NativeApp.GetDbConnector()); + + ((UserDataManager)UserDataManager).Repository = userDataRepo; + await itemRepo.Initialize(userDataRepo).ConfigureAwait(false); ((LibraryManager)LibraryManager).ItemRepository = ItemRepository; await ConfigureNotificationsRepository().ConfigureAwait(false); progress.Report(100); @@ -647,15 +650,20 @@ namespace MediaBrowser.Server.Startup.Common /// <returns>Task.</returns> private async Task RegisterMediaEncoder(IProgress<double> progress) { + string encoderPath = null; + string probePath = null; + var info = await new FFMpegLoader(Logger, ApplicationPaths, HttpClient, ZipClient, FileSystemManager, NativeApp.Environment, NativeApp.GetFfmpegInstallInfo()) .GetFFMpegInfo(NativeApp.Environment, _startupOptions, progress).ConfigureAwait(false); - _hasExternalEncoder = string.Equals(info.Version, "custom", StringComparison.OrdinalIgnoreCase); + encoderPath = info.EncoderPath; + probePath = info.ProbePath; + _hasExternalEncoder = string.Equals(info.Version, "external", StringComparison.OrdinalIgnoreCase); var mediaEncoder = new MediaEncoder(LogManager.GetLogger("MediaEncoder"), JsonSerializer, - info.EncoderPath, - info.ProbePath, + encoderPath, + probePath, _hasExternalEncoder, ServerConfigurationManager, FileSystemManager, @@ -747,18 +755,6 @@ namespace MediaBrowser.Server.Startup.Common } /// <summary> - /// Configures the user data repositories. - /// </summary> - private async Task ConfigureUserDataRepositories() - { - var repo = new SqliteUserDataRepository(LogManager, ApplicationPaths, NativeApp.GetDbConnector()); - - await repo.Initialize().ConfigureAwait(false); - - ((UserDataManager)UserDataManager).Repository = repo; - } - - /// <summary> /// Dirty hacks /// </summary> private void SetStaticProperties() @@ -1145,7 +1141,8 @@ namespace MediaBrowser.Server.Startup.Common ServerName = FriendlyName, LocalAddress = localAddress, SupportsLibraryMonitor = SupportsLibraryMonitor, - HasExternalEncoder = _hasExternalEncoder + HasExternalEncoder = _hasExternalEncoder, + SystemArchitecture = NativeApp.Environment.SystemArchitecture }; } |
