mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 11:57:55 +02:00
Respect AutoRunWebApp and NoAutoRunWebApp settings when HostWebClient is false
This commit is contained in:
parent
32ccab32bf
commit
bd81825d2d
1 changed files with 23 additions and 13 deletions
|
@ -32,30 +32,40 @@ namespace Emby.Server.Implementations.EntryPoints
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Task RunAsync()
|
public Task RunAsync()
|
||||||
{
|
{
|
||||||
if (!_appHost.CanLaunchWebBrowser)
|
Run();
|
||||||
{
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_appConfig.HostWebClient())
|
private void Run()
|
||||||
|
{
|
||||||
|
if (!_appHost.CanLaunchWebBrowser)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Always launch the startup wizard if possible when it has not been completed
|
||||||
|
if (!_config.Configuration.IsStartupWizardCompleted && _appConfig.HostWebClient())
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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);
|
BrowserLauncher.OpenSwaggerPage(_appHost);
|
||||||
}
|
}
|
||||||
else if (!_config.Configuration.IsStartupWizardCompleted)
|
|
||||||
{
|
|
||||||
BrowserLauncher.OpenWebApp(_appHost);
|
|
||||||
}
|
|
||||||
else if (_config.Configuration.AutoRunWebApp)
|
|
||||||
{
|
|
||||||
var options = ((ApplicationHost)_appHost).StartupOptions;
|
|
||||||
|
|
||||||
if (!options.NoAutoRunWebApp)
|
|
||||||
{
|
|
||||||
BrowserLauncher.OpenWebApp(_appHost);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
Loading…
Reference in a new issue