Use the swagger API page as the default redirect path if not hosting the jellyfin-web content
This commit is contained in:
parent
1b5999a1bc
commit
f3be93a4de
|
@ -3,9 +3,15 @@ using static MediaBrowser.Controller.Extensions.ConfigurationExtensions;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations
|
namespace Emby.Server.Implementations
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Static class containing the default configuration options for the web server.
|
||||||
|
/// </summary>
|
||||||
public static class ConfigurationOptions
|
public static class ConfigurationOptions
|
||||||
{
|
{
|
||||||
public static Dictionary<string, string> Configuration => new Dictionary<string, string>
|
/// <summary>
|
||||||
|
/// Gets the default configuration options.
|
||||||
|
/// </summary>
|
||||||
|
public static Dictionary<string, string> DefaultConfiguration => new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "HttpListenerHost:DefaultRedirectPath", "web/index.html" },
|
{ "HttpListenerHost:DefaultRedirectPath", "web/index.html" },
|
||||||
{ "MusicBrainz:BaseUrl", "https://www.musicbrainz.org" },
|
{ "MusicBrainz:BaseUrl", "https://www.musicbrainz.org" },
|
||||||
|
|
|
@ -468,9 +468,16 @@ namespace Jellyfin.Server
|
||||||
await resource.CopyToAsync(dst).ConfigureAwait(false);
|
await resource.CopyToAsync(dst).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use the swagger API page as the default redirect path if not hosting the jellyfin-web content
|
||||||
|
var inMemoryDefaultConfig = ConfigurationOptions.DefaultConfiguration;
|
||||||
|
if (string.IsNullOrEmpty(appPaths.WebPath))
|
||||||
|
{
|
||||||
|
inMemoryDefaultConfig["HttpListenerHost:DefaultRedirectPath"] = "swagger/index.html";
|
||||||
|
}
|
||||||
|
|
||||||
return new ConfigurationBuilder()
|
return new ConfigurationBuilder()
|
||||||
.SetBasePath(appPaths.ConfigurationDirectoryPath)
|
.SetBasePath(appPaths.ConfigurationDirectoryPath)
|
||||||
.AddInMemoryCollection(ConfigurationOptions.Configuration)
|
.AddInMemoryCollection(inMemoryDefaultConfig)
|
||||||
.AddJsonFile("logging.json", false, true)
|
.AddJsonFile("logging.json", false, true)
|
||||||
.AddEnvironmentVariables("JELLYFIN_")
|
.AddEnvironmentVariables("JELLYFIN_")
|
||||||
.Build();
|
.Build();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user