mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-25 06:58:40 +02:00
Open the Swagger API page on server start if not hosting the static web content
This commit is contained in:
parent
26af5ea45a
commit
1b5999a1bc
|
@ -244,6 +244,9 @@ namespace Emby.Server.Implementations
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ContentRoot { get; private set; }
|
public string ContentRoot { get; private set; }
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public bool IsHostingContent => ContentRoot != null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the server configuration manager.
|
/// Gets the server configuration manager.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -29,6 +29,16 @@ namespace Emby.Server.Implementations.Browser
|
||||||
OpenDashboardPage("index.html", appHost);
|
OpenDashboardPage("index.html", appHost);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opens the swagger API page.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="appHost">The app host.</param>
|
||||||
|
public static void OpenSwaggerPage(IServerApplicationHost appHost)
|
||||||
|
{
|
||||||
|
var url = appHost.GetLocalApiUrl("localhost") + "/swagger/index.html";
|
||||||
|
OpenUrl(appHost, url);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Opens the URL.
|
/// Opens the URL.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -36,7 +36,11 @@ namespace Emby.Server.Implementations.EntryPoints
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_config.Configuration.IsStartupWizardCompleted)
|
if (!_appHost.IsHostingContent)
|
||||||
|
{
|
||||||
|
BrowserLauncher.OpenSwaggerPage(_appHost);
|
||||||
|
}
|
||||||
|
else if (!_config.Configuration.IsStartupWizardCompleted)
|
||||||
{
|
{
|
||||||
BrowserLauncher.OpenWebApp(_appHost);
|
BrowserLauncher.OpenWebApp(_appHost);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,11 @@ namespace MediaBrowser.Controller
|
||||||
{
|
{
|
||||||
event EventHandler HasUpdateAvailableChanged;
|
event EventHandler HasUpdateAvailableChanged;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether the server is hosting the static web content from jellyfin-web.
|
||||||
|
/// </summary>
|
||||||
|
bool IsHostingContent { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the system info.
|
/// Gets the system info.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in a new issue