diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2019-10-27 13:52:08 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-27 13:52:08 -0400 |
| commit | 53ee78170ad3d5d5d0ecac2dbe8dcbfb13940e46 (patch) | |
| tree | 1ad4126058814609352d41b78662fd5838d6677a /MediaBrowser.Model/Configuration/ServerConfiguration.cs | |
| parent | 2cdf5c203a9335100b19b9609a738e1b64d6631d (diff) | |
| parent | c9f4a74af02e08b895cd6a8b8a408b1c0edfb6c4 (diff) | |
Merge branch 'master' into copr-fix
Diffstat (limited to 'MediaBrowser.Model/Configuration/ServerConfiguration.cs')
| -rw-r--r-- | MediaBrowser.Model/Configuration/ServerConfiguration.cs | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 24e771403..b8abe49e3 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -10,6 +10,7 @@ namespace MediaBrowser.Model.Configuration { public const int DefaultHttpPort = 8096; public const int DefaultHttpsPort = 8920; + private string _baseUrl; /// <summary> /// Gets or sets a value indicating whether [enable u pn p]. @@ -162,7 +163,33 @@ namespace MediaBrowser.Model.Configuration public bool SkipDeserializationForBasicTypes { get; set; } public string ServerName { get; set; } - public string BaseUrl { get; set; } + public string BaseUrl + { + get => _baseUrl; + set + { + // Normalize the start of the string + if (string.IsNullOrWhiteSpace(value)) + { + // If baseUrl is empty, set an empty prefix string + value = string.Empty; + } + else if (!value.StartsWith("/")) + { + // If baseUrl was not configured with a leading slash, append one for consistency + value = "/" + value; + } + + // Normalize the end of the string + if (value.EndsWith("/")) + { + // If baseUrl was configured with a trailing slash, remove it for consistency + value = value.Remove(value.Length - 1); + } + + _baseUrl = value; + } + } public string UICulture { get; set; } @@ -243,7 +270,7 @@ namespace MediaBrowser.Model.Configuration SortRemoveCharacters = new[] { ",", "&", "-", "{", "}", "'" }; SortRemoveWords = new[] { "the", "a", "an" }; - BaseUrl = "jellyfin"; + BaseUrl = string.Empty; UICulture = "en-US"; MetadataOptions = new[] |
