diff options
| author | Bond-009 <bond.009@outlook.com> | 2020-04-22 14:25:31 +0200 |
|---|---|---|
| committer | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-22 13:05:03 -0400 |
| commit | d744d7d23492c4e26260383d20e1f3b59db16a66 (patch) | |
| tree | 16b1e05e294c770e3a4018983cd60f37cbd1f7b6 /Emby.Server.Implementations/EntryPoints/StartupWizard.cs | |
| parent | bc4e72b29b7e43242028549df1d2471e65b045bc (diff) | |
| parent | a85b1dcba663fe3bbb2441380cd8da382c92f2bd (diff) | |
Merge branch 'master' into register-services-correctly
Diffstat (limited to 'Emby.Server.Implementations/EntryPoints/StartupWizard.cs')
| -rw-r--r-- | Emby.Server.Implementations/EntryPoints/StartupWizard.cs | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs index af1604aa6..2e738deeb 100644 --- a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs +++ b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs @@ -40,28 +40,39 @@ namespace Emby.Server.Implementations.EntryPoints /// <inheritdoc /> public Task RunAsync() { + Run(); + return Task.CompletedTask; + } + + private void Run() + { if (!_appHost.CanLaunchWebBrowser) { - return Task.CompletedTask; + return; } - if (!_appConfig.HostWebClient()) + // Always launch the startup wizard if possible when it has not been completed + if (!_config.Configuration.IsStartupWizardCompleted && _appConfig.HostWebClient()) { - BrowserLauncher.OpenSwaggerPage(_appHost); + BrowserLauncher.OpenWebApp(_appHost); + return; } - else if (!_config.Configuration.IsStartupWizardCompleted) + + // Do nothing if the web app is configured to not run automatically + if (!_config.Configuration.AutoRunWebApp || _startupOptions.NoAutoRunWebApp) + { + return; + } + + // Launch the swagger page if the web client is not hosted, otherwise open the web client + if (_appConfig.HostWebClient()) { BrowserLauncher.OpenWebApp(_appHost); } - else if (_config.Configuration.AutoRunWebApp) + else { - if (!_startupOptions.NoAutoRunWebApp) - { - BrowserLauncher.OpenWebApp(_appHost); - } + BrowserLauncher.OpenSwaggerPage(_appHost); } - - return Task.CompletedTask; } /// <inheritdoc /> |
