From 924ec0c191b66520f7ec7d3f6dc556e06305846b Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Sun, 20 Jan 2019 01:12:44 +0100 Subject: Revert Jellyfin.Versioning, Update all versions and user agents. --- Emby.Server.Implementations/ApplicationHost.cs | 35 +++++++--------------- .../Emby.Server.Implementations.csproj | 3 +- .../LiveTv/Listings/SchedulesDirect.cs | 2 +- .../LiveTv/TunerHosts/M3uParser.cs | 2 +- 4 files changed, 13 insertions(+), 29 deletions(-) (limited to 'Emby.Server.Implementations') diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index f186ccdaa1..91ba3903d5 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -47,7 +47,6 @@ using Emby.Server.Implementations.Threading; using Emby.Server.Implementations.TV; using Emby.Server.Implementations.Updates; using Emby.Server.Implementations.Xml; -using Jellyfin.Versioning; using MediaBrowser.Api; using MediaBrowser.Common; using MediaBrowser.Common.Configuration; @@ -430,28 +429,20 @@ namespace Emby.Server.Implementations _validAddressResults.Clear(); } - private Version _version; - /// - /// Gets the current application version - /// - /// The application version. - public Version ApplicationVersion => _version ?? (_version = ApplicationExtendedVersion.ApiVersion); - - private Version _serverVersion; + private Version _applicationVersion; /// /// Gets the current application server version /// /// The application server version. - public Version ApplicationServerVersion => _serverVersion ?? (_serverVersion = typeof(ApplicationHost).Assembly.GetName().Version); + public Version ApplicationVersion => _applicationVersion ?? (_applicationVersion = typeof(ApplicationHost).Assembly.GetName().Version); + + public string ApplicationSemanticVersion => ApplicationVersion.ToString(3); - private ExtendedVersion _extendedVersion; /// /// Gets the current application server version /// /// The application server version. - public ExtendedVersion ApplicationExtendedVersion => _extendedVersion ?? - (_extendedVersion = typeof(ApplicationHost).Assembly.GetCustomAttributes(typeof(AssemblyExtendedVersion), false) - .Cast().FirstOrDefault().ExtendedVersion); + public string ApplicationUserAgent => Name + "/" + ApplicationSemanticVersion; private string _productName; /// @@ -478,7 +469,7 @@ namespace Emby.Server.Implementations /// Gets the name. /// /// The name. - public string Name => "Emby Server"; + public string Name => "Jellyfin"; private static Tuple GetAssembly(Type type) { @@ -1028,9 +1019,7 @@ namespace Emby.Server.Implementations protected string GetDefaultUserAgent() { - var name = FormatAttribute(Name); - - return name + "/" + ApplicationVersion; + return ApplicationUserAgent; } private static string FormatAttribute(string str) @@ -1044,7 +1033,7 @@ namespace Emby.Server.Implementations if (string.IsNullOrWhiteSpace(result)) { - result = "Emby"; + result = "Jellyfin"; } return result; @@ -1849,9 +1838,7 @@ namespace Emby.Server.Implementations { HasPendingRestart = HasPendingRestart, IsShuttingDown = IsShuttingDown, - Version = ApplicationVersion.ToString(), - ServerVersion = ApplicationServerVersion.ToString(), - ExtendedVersion = ApplicationExtendedVersion, + Version = ApplicationSemanticVersion, ProductName = ApplicationProductName, WebSocketPortNumber = HttpPort, CompletedInstallations = InstallationManager.CompletedInstallations.ToArray(), @@ -1898,9 +1885,7 @@ namespace Emby.Server.Implementations var wanAddress = await GetWanApiUrl(cancellationToken).ConfigureAwait(false); return new PublicSystemInfo { - Version = ApplicationVersion.ToString(), - ServerVersion = ApplicationServerVersion.ToString(), - ExtendedVersion = ApplicationExtendedVersion, + Version = ApplicationSemanticVersion, Id = SystemId, OperatingSystem = EnvironmentInfo.OperatingSystem.ToString(), WanAddress = wanAddress, diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index 843718756d..5a0e1da4d7 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -3,7 +3,6 @@ - @@ -31,7 +30,7 @@ - + diff --git a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs index d3066e9161..0bbffb824b 100644 --- a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs +++ b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs @@ -38,7 +38,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings _appHost = appHost; } - private string UserAgent => "Emby/" + _appHost.ApplicationVersion; + private string UserAgent => _appHost.ApplicationUserAgent; private static List GetScheduleRequestDates(DateTime startDateUtc, DateTime endDateUtc) { diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs index c77559c75d..7d6c0f67bd 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs @@ -58,7 +58,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts Url = url, CancellationToken = cancellationToken, // Some data providers will require a user agent - UserAgent = _appHost.FriendlyName + "/" + _appHost.ApplicationVersion + UserAgent = _appHost.ApplicationSemanticVersion }); } return Task.FromResult(_fileSystem.OpenRead(url)); -- cgit v1.2.3