aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2020-04-22 13:02:45 +0200
committerGitHub <noreply@github.com>2020-04-22 13:02:45 +0200
commita85b1dcba663fe3bbb2441380cd8da382c92f2bd (patch)
tree5f63e9cbf37795ff4eded315a129c31f9fcced3f /Emby.Server.Implementations/EntryPoints/StartupWizard.cs
parentde328a46cdba2182c478761659e3b6fd3a8dc0c0 (diff)
parentbd81825d2d2abba551d97d5c75890358d961fd27 (diff)
Merge pull request #2943 from mark-monteiro/fix-browser-autolaunch
Respect AutoRunWebApp and NoAutoRunWebApp settings when HostWebClient is false
Diffstat (limited to 'Emby.Server.Implementations/EntryPoints/StartupWizard.cs')
-rw-r--r--Emby.Server.Implementations/EntryPoints/StartupWizard.cs36
1 files changed, 23 insertions, 13 deletions
diff --git a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
index 8e9771931..a0a653d75 100644
--- a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
+++ b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
@@ -32,30 +32,40 @@ 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;
+ }
+
+ // Do nothing if the web app is configured to not run automatically
+ var options = ((ApplicationHost)_appHost).StartupOptions;
+ if (!_config.Configuration.AutoRunWebApp || options.NoAutoRunWebApp)
+ {
+ return;
}
- else if (!_config.Configuration.IsStartupWizardCompleted)
+
+ // 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
{
- var options = ((ApplicationHost)_appHost).StartupOptions;
-
- if (!options.NoAutoRunWebApp)
- {
- BrowserLauncher.OpenWebApp(_appHost);
- }
+ BrowserLauncher.OpenSwaggerPage(_appHost);
}
-
- return Task.CompletedTask;
}
/// <inheritdoc />