diff options
| author | Andrew Rabert <6550543+nvllsvm@users.noreply.github.com> | 2019-01-19 22:39:20 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-19 22:39:20 -0500 |
| commit | d72d0fb865f2eccef4f96a6ebc5f1e409778608f (patch) | |
| tree | 861fe50186c70010e6fc2bca1ef5bd2efd474e6f /Emby.Server.Implementations/ApplicationHost.cs | |
| parent | 469590c9c51f028da454e7e31bea0e37b8f91f15 (diff) | |
| parent | f229c641a14d45485aac63aabd09f16c5aec28ce (diff) | |
Merge pull request #627 from nvllsvm/version
Use string for ApplicationVersion
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index f0e2eec20..b4b90ac86 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -429,20 +429,13 @@ namespace Emby.Server.Implementations _validAddressResults.Clear(); } - private Version _applicationVersion; - /// <summary> - /// Gets the current application server version - /// </summary> - /// <value>The application server version.</value> - public Version ApplicationVersion => _applicationVersion ?? (_applicationVersion = typeof(ApplicationHost).Assembly.GetName().Version); - - public string ApplicationSemanticVersion => ApplicationVersion.ToString(3); + public string ApplicationVersion => typeof(ApplicationHost).Assembly.GetName().Version.ToString(3); /// <summary> - /// Gets the current application server version + /// Gets the current application user agent /// </summary> - /// <value>The application server version.</value> - public string ApplicationUserAgent => Name.Replace(' ','-') + "/" + ApplicationSemanticVersion; + /// <value>The application user agent.</value> + public string ApplicationUserAgent => Name.Replace(' ','-') + "/" + ApplicationVersion; private string _productName; /// <summary> @@ -759,7 +752,7 @@ namespace Emby.Server.Implementations protected virtual IHttpClient CreateHttpClient() { - return new HttpClientManager.HttpClientManager(ApplicationPaths, LoggerFactory.CreateLogger("HttpClient"), FileSystemManager, GetDefaultUserAgent); + return new HttpClientManager.HttpClientManager(ApplicationPaths, LoggerFactory.CreateLogger("HttpClient"), FileSystemManager, () => ApplicationUserAgent); } public static IStreamHelper StreamHelper { get; set; } @@ -1017,11 +1010,6 @@ namespace Emby.Server.Implementations } } - protected string GetDefaultUserAgent() - { - return ApplicationUserAgent; - } - protected virtual bool SupportsDualModeSockets => true; private X509Certificate GetCertificate(CertificateInfo info) @@ -1821,7 +1809,7 @@ namespace Emby.Server.Implementations { HasPendingRestart = HasPendingRestart, IsShuttingDown = IsShuttingDown, - Version = ApplicationSemanticVersion, + Version = ApplicationVersion, ProductName = ApplicationProductName, WebSocketPortNumber = HttpPort, CompletedInstallations = InstallationManager.CompletedInstallations.ToArray(), @@ -1868,7 +1856,7 @@ namespace Emby.Server.Implementations var wanAddress = await GetWanApiUrl(cancellationToken).ConfigureAwait(false); return new PublicSystemInfo { - Version = ApplicationSemanticVersion, + Version = ApplicationVersion, Id = SystemId, OperatingSystem = EnvironmentInfo.OperatingSystem.ToString(), WanAddress = wanAddress, |
