Merge pull request #2943 from mark-monteiro/fix-browser-autolaunch

Respect AutoRunWebApp and NoAutoRunWebApp settings when HostWebClient is false
pull/2861/head^2
Bond-009 5 years ago committed by GitHub
commit a85b1dcba6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -32,30 +32,40 @@ namespace Emby.Server.Implementations.EntryPoints
/// <inheritdoc />
public Task RunAsync()
{
if (!_appHost.CanLaunchWebBrowser)
{
Run();
return Task.CompletedTask;
}
if (!_appConfig.HostWebClient())
private void Run()
{
BrowserLauncher.OpenSwaggerPage(_appHost);
if (!_appHost.CanLaunchWebBrowser)
{
return;
}
else if (!_config.Configuration.IsStartupWizardCompleted)
// Always launch the startup wizard if possible when it has not been completed
if (!_config.Configuration.IsStartupWizardCompleted && _appConfig.HostWebClient())
{
BrowserLauncher.OpenWebApp(_appHost);
return;
}
else if (_config.Configuration.AutoRunWebApp)
{
// Do nothing if the web app is configured to not run automatically
var options = ((ApplicationHost)_appHost).StartupOptions;
if (!_config.Configuration.AutoRunWebApp || options.NoAutoRunWebApp)
{
return;
}
if (!options.NoAutoRunWebApp)
// Launch the swagger page if the web client is not hosted, otherwise open the web client
if (_appConfig.HostWebClient())
{
BrowserLauncher.OpenWebApp(_appHost);
}
else
{
BrowserLauncher.OpenSwaggerPage(_appHost);
}
return Task.CompletedTask;
}
/// <inheritdoc />

Loading…
Cancel
Save