aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Emby.Server.Implementations/ConfigurationOptions.cs8
-rw-r--r--Jellyfin.Server/Program.cs9
2 files changed, 15 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/ConfigurationOptions.cs b/Emby.Server.Implementations/ConfigurationOptions.cs
index 2ea7ff6e9..b733bd2d5 100644
--- a/Emby.Server.Implementations/ConfigurationOptions.cs
+++ b/Emby.Server.Implementations/ConfigurationOptions.cs
@@ -3,9 +3,15 @@ using static MediaBrowser.Controller.Extensions.ConfigurationExtensions;
namespace Emby.Server.Implementations
{
+ /// <summary>
+ /// Static class containing the default configuration options for the web server.
+ /// </summary>
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" },
{ "MusicBrainz:BaseUrl", "https://www.musicbrainz.org" },
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index 2ce7379fb..8c133576c 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -468,9 +468,16 @@ namespace Jellyfin.Server
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()
.SetBasePath(appPaths.ConfigurationDirectoryPath)
- .AddInMemoryCollection(ConfigurationOptions.Configuration)
+ .AddInMemoryCollection(inMemoryDefaultConfig)
.AddJsonFile("logging.json", false, true)
.AddEnvironmentVariables("JELLYFIN_")
.Build();