Revert Jellyfin.Versioning, Update all versions and user agents.

This commit is contained in:
Erwin de Haan 2019-01-20 01:12:44 +01:00
parent bb8df8dfa0
commit 924ec0c191
43 changed files with 61 additions and 426 deletions

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -164,7 +164,7 @@ namespace Emby.Dlna.PlayTo
string deviceName = null; string deviceName = null;
var sessionInfo = _sessionManager.LogSessionActivity("DLNA", _appHost.ApplicationVersion.ToString(), uuid, deviceName, uri.OriginalString, null); var sessionInfo = _sessionManager.LogSessionActivity("DLNA", _appHost.ApplicationSemanticVersion, uuid, deviceName, uri.OriginalString, null);
var controller = sessionInfo.SessionControllers.OfType<PlayToController>().FirstOrDefault(); var controller = sessionInfo.SessionControllers.OfType<PlayToController>().FirstOrDefault();

View File

@ -17,7 +17,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -6,7 +6,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<ItemGroup> <ItemGroup>
<Compile Include="..\..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -6,7 +6,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -6,7 +6,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -7,7 +7,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>

View File

@ -47,7 +47,6 @@ using Emby.Server.Implementations.Threading;
using Emby.Server.Implementations.TV; using Emby.Server.Implementations.TV;
using Emby.Server.Implementations.Updates; using Emby.Server.Implementations.Updates;
using Emby.Server.Implementations.Xml; using Emby.Server.Implementations.Xml;
using Jellyfin.Versioning;
using MediaBrowser.Api; using MediaBrowser.Api;
using MediaBrowser.Common; using MediaBrowser.Common;
using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Configuration;
@ -430,28 +429,20 @@ namespace Emby.Server.Implementations
_validAddressResults.Clear(); _validAddressResults.Clear();
} }
private Version _version; private Version _applicationVersion;
/// <summary>
/// Gets the current application version
/// </summary>
/// <value>The application version.</value>
public Version ApplicationVersion => _version ?? (_version = ApplicationExtendedVersion.ApiVersion);
private Version _serverVersion;
/// <summary> /// <summary>
/// Gets the current application server version /// Gets the current application server version
/// </summary> /// </summary>
/// <value>The application server version.</value> /// <value>The application server version.</value>
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;
/// <summary> /// <summary>
/// Gets the current application server version /// Gets the current application server version
/// </summary> /// </summary>
/// <value>The application server version.</value> /// <value>The application server version.</value>
public ExtendedVersion ApplicationExtendedVersion => _extendedVersion ?? public string ApplicationUserAgent => Name + "/" + ApplicationSemanticVersion;
(_extendedVersion = typeof(ApplicationHost).Assembly.GetCustomAttributes(typeof(AssemblyExtendedVersion), false)
.Cast<AssemblyExtendedVersion>().FirstOrDefault().ExtendedVersion);
private string _productName; private string _productName;
/// <summary> /// <summary>
@ -478,7 +469,7 @@ namespace Emby.Server.Implementations
/// Gets the name. /// Gets the name.
/// </summary> /// </summary>
/// <value>The name.</value> /// <value>The name.</value>
public string Name => "Emby Server"; public string Name => "Jellyfin";
private static Tuple<Assembly, string> GetAssembly(Type type) private static Tuple<Assembly, string> GetAssembly(Type type)
{ {
@ -1028,9 +1019,7 @@ namespace Emby.Server.Implementations
protected string GetDefaultUserAgent() protected string GetDefaultUserAgent()
{ {
var name = FormatAttribute(Name); return ApplicationUserAgent;
return name + "/" + ApplicationVersion;
} }
private static string FormatAttribute(string str) private static string FormatAttribute(string str)
@ -1044,7 +1033,7 @@ namespace Emby.Server.Implementations
if (string.IsNullOrWhiteSpace(result)) if (string.IsNullOrWhiteSpace(result))
{ {
result = "Emby"; result = "Jellyfin";
} }
return result; return result;
@ -1849,9 +1838,7 @@ namespace Emby.Server.Implementations
{ {
HasPendingRestart = HasPendingRestart, HasPendingRestart = HasPendingRestart,
IsShuttingDown = IsShuttingDown, IsShuttingDown = IsShuttingDown,
Version = ApplicationVersion.ToString(), Version = ApplicationSemanticVersion,
ServerVersion = ApplicationServerVersion.ToString(),
ExtendedVersion = ApplicationExtendedVersion,
ProductName = ApplicationProductName, ProductName = ApplicationProductName,
WebSocketPortNumber = HttpPort, WebSocketPortNumber = HttpPort,
CompletedInstallations = InstallationManager.CompletedInstallations.ToArray(), CompletedInstallations = InstallationManager.CompletedInstallations.ToArray(),
@ -1898,9 +1885,7 @@ namespace Emby.Server.Implementations
var wanAddress = await GetWanApiUrl(cancellationToken).ConfigureAwait(false); var wanAddress = await GetWanApiUrl(cancellationToken).ConfigureAwait(false);
return new PublicSystemInfo return new PublicSystemInfo
{ {
Version = ApplicationVersion.ToString(), Version = ApplicationSemanticVersion,
ServerVersion = ApplicationServerVersion.ToString(),
ExtendedVersion = ApplicationExtendedVersion,
Id = SystemId, Id = SystemId,
OperatingSystem = EnvironmentInfo.OperatingSystem.ToString(), OperatingSystem = EnvironmentInfo.OperatingSystem.ToString(),
WanAddress = wanAddress, WanAddress = wanAddress,

View File

@ -3,7 +3,6 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Emby.Naming\Emby.Naming.csproj" /> <ProjectReference Include="..\Emby.Naming\Emby.Naming.csproj" />
<ProjectReference Include="..\Emby.Notifications\Emby.Notifications.csproj" /> <ProjectReference Include="..\Emby.Notifications\Emby.Notifications.csproj" />
<ProjectReference Include="..\Jellyfin.Versioning\Jellyfin.Versioning.csproj" />
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" /> <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
<ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj" /> <ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj" />
<ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" /> <ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
@ -31,7 +30,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>

View File

@ -38,7 +38,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
_appHost = appHost; _appHost = appHost;
} }
private string UserAgent => "Emby/" + _appHost.ApplicationVersion; private string UserAgent => _appHost.ApplicationUserAgent;
private static List<string> GetScheduleRequestDates(DateTime startDateUtc, DateTime endDateUtc) private static List<string> GetScheduleRequestDates(DateTime startDateUtc, DateTime endDateUtc)
{ {

View File

@ -58,7 +58,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
Url = url, Url = url,
CancellationToken = cancellationToken, CancellationToken = cancellationToken,
// Some data providers will require a user agent // Some data providers will require a user agent
UserAgent = _appHost.FriendlyName + "/" + _appHost.ApplicationVersion UserAgent = _appHost.ApplicationSemanticVersion
}); });
} }
return Task.FromResult(_fileSystem.OpenRead(url)); return Task.FromResult(_fileSystem.OpenRead(url));

View File

@ -6,11 +6,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\..\SharedVersion.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Jellyfin.Versioning\Jellyfin.Versioning.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -13,7 +13,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -46,7 +46,6 @@
<ProjectReference Include="..\Emby.Drawing.Skia\Emby.Drawing.Skia.csproj" /> <ProjectReference Include="..\Emby.Drawing.Skia\Emby.Drawing.Skia.csproj" />
<ProjectReference Include="..\Emby.IsoMounting\IsoMounter\IsoMounter.csproj" /> <ProjectReference Include="..\Emby.IsoMounting\IsoMounter\IsoMounter.csproj" />
<ProjectReference Include="..\Emby.Server.Implementations\Emby.Server.Implementations.csproj" /> <ProjectReference Include="..\Emby.Server.Implementations\Emby.Server.Implementations.csproj" />
<ProjectReference Include="..\Jellyfin.Versioning\Jellyfin.Versioning.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,48 +0,0 @@
// Jellyfin.Versioning/AssemblyExtendedVersion.cs
// Part of the Jellyfin project (https://jellyfin.media)
//
// All copyright belongs to the Jellyfin contributors; a full list can
// be found in the file CONTRIBUTORS.md
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
namespace Jellyfin.Versioning
{
[AttributeUsage(AttributeTargets.Assembly)]
public sealed class AssemblyExtendedVersion : Attribute
{
public ExtendedVersion ExtendedVersion { get; }
public AssemblyExtendedVersion(ExtendedVersion ExtendedVersion)
{
this.ExtendedVersion = ExtendedVersion;
}
public AssemblyExtendedVersion(string apiVersion, bool readResource = true)
{
var assembly = Assembly.GetExecutingAssembly();
var resourceName = "Jellyfin.Versioning.jellyfin_version.ini";
using (var stream = assembly.GetManifestResourceStream(resourceName))
{
ExtendedVersion = new ExtendedVersion(new Version(apiVersion), stream);
}
}
}
}

View File

@ -1,133 +0,0 @@
// Jellyfin.Versioning/ExtendedVersion.cs
// Part of the Jellyfin project (https://jellyfin.media)
//
// All copyright belongs to the Jellyfin contributors; a full list can
// be found in the file CONTRIBUTORS.md
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
namespace Jellyfin.Versioning
{
public class ExtendedVersion
{
[IgnoreDataMember]
public Version ApiVersion { get; }
public string CommitHash { get; } = String.Empty;
public long Revision { get; } = 0;
public string Branch { get; } = String.Empty;
public string TagDescription { get; } = String.Empty;
[IgnoreDataMember]
public Uri Remote { get; } = null;
public ExtendedVersion(Version apiVersion, Stream extendedVersionFileStream)
{
ApiVersion = apiVersion;
int line = 1;
using (var reader = new StreamReader(extendedVersionFileStream))
{
while (!reader.EndOfStream)
{
string item = reader.ReadLine();
if (string.IsNullOrWhiteSpace(item.Trim()))
{
//empty line, skip
continue;
}
var kvpair = item.Split('=');
if (kvpair.Length != 2)
{
throw new ArgumentException(nameof(extendedVersionFileStream),
$"ExtendedVersionFile contains bad key-value pair '{item}' at line {line}.");
}
var key = kvpair[0].Trim().ToLower();
var value = kvpair[1].Trim();
switch (key)
{
case "commit":
if (value.Length < 7 || value.Length > 40)
{
throw new ArgumentException(nameof(extendedVersionFileStream),
$"ExtendedVersionFile has a bad commit hash '{value}' on line {line}, it should be a string between 7 and 40 characters.");
}
CommitHash = value;
break;
case "branch":
if (string.IsNullOrWhiteSpace(value))
{
throw new ArgumentException(nameof(extendedVersionFileStream),
$"ExtendedVersionFile has a bad branch '{value}' on line {line}, it can not be empty.");
}
Branch = value;
break;
case "revision":
if (!long.TryParse(value, out long rev))
{
throw new ArgumentException(nameof(extendedVersionFileStream),
$"ExtendedVersionFile has a bad revision '{value}' on line {line}, it should be an integer.");
}
Revision = rev;
break;
case "tagdesc":
if (string.IsNullOrWhiteSpace(value))
{
throw new ArgumentException(nameof(extendedVersionFileStream),
$"ExtendedVersionFile has a bad tag description '{value}' on line {line}, it can not be empty.");
}
TagDescription = value;
break;
case "remote":
var remoteRepo = value.Replace(".git", string.Empty).Replace("git@github.com:", "https://github.com/");
if (Uri.IsWellFormedUriString(remoteRepo, UriKind.Absolute))
{
Remote = new Uri(remoteRepo);
}
else if (Uri.IsWellFormedUriString(value, UriKind.Absolute))
{
//fallback if the replace about broke the Uri
Remote = new Uri(value);
}
else
{
throw new ArgumentException(nameof(extendedVersionFileStream),
$"ExtendedVersionFile has a bad remote URI '{value}' on line {line}, it should be a valid remote URI (ssh or https).");
}
break;
default:
throw new ArgumentException(nameof(extendedVersionFileStream),
$"ExtendedVersionFile contains an unrecognized key-value pair '{item}' at line {line}.");
}
line++;
}
}
}
public override string ToString()
{
return $"{ApiVersion};{CommitHash};{Revision};{Branch};{TagDescription};{Remote}";
}
}
}

View File

@ -1,20 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<None Remove="jellyfin_version.ini" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="jellyfin_version.ini" />
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="$(ProjectDir)update-version" />
</Target>
</Project>

View File

@ -1,21 +0,0 @@
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Jellyfin.Versioning")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

View File

@ -1,8 +0,0 @@
using System.Reflection;
using Jellyfin.Versioning;
//To keep compatibility with Emby do not remove the revision (fourth number)
[assembly: AssemblyVersion("10.0.1.0")]
[assembly: AssemblyFileVersion("10.0.1.0")]
[assembly: AssemblyInformationalVersion("10.0.1.0")]
[assembly: AssemblyExtendedVersion("3.5.2.0", true)]

View File

@ -1,44 +0,0 @@
#!/usr/bin/env sh
# Jellyfin.Versioning/update-version
# Part of the Jellyfin project (https://jellyfin.media)
#
# All copyright belongs to the Jellyfin contributors; a full list can
# be found in the file CONTRIBUTORS.md
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
if [ -d "$(dirname "$0")/../.git" ]; then
commit=`git rev-parse HEAD`
count=`git rev-list HEAD --count`
branch=`git rev-parse --abbrev-ref HEAD`
desc=`git describe --tags --always --long`
remote=`git config --get remote.origin.url`
tee jellyfin_version.ini <<EOF
commit=$commit
revision=$count
branch=$branch
tagdesc=$desc
remote=$remote
EOF
cat <<EOF
Updated build version in jellyfin_version.ini
commit=$commit
revision=$count
branch=$branch
tagdesc=$desc
remote=$remote
EOF
else
echo Did not update build version because there was no .git directory.
fi

View File

@ -1,23 +0,0 @@
@ECHO OFF
goto licenseblock
update-version.bat
Part of the Jellyfin project (https://jellyfin.media)
All copyright belongs to the Jellyfin contributors; a full list can
be found in the file CONTRIBUTORS.md
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
:licenseblock
powershell.exe -executionpolicy Bypass -file update-version.ps1

View File

@ -1,31 +0,0 @@
# Jellyfin.Versioning/update-version.ps1
# Part of the Jellyfin project (https://jellyfin.media)
#
# All copyright belongs to the Jellyfin contributors; a full list can
# be found in the file CONTRIBUTORS.md
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
if(Test-Path -Path '..\.git' ){
$commit = (git rev-parse HEAD)
$count = (git rev-list HEAD --count)
$branch = (git rev-parse --abbrev-ref HEAD)
$desc = (git describe --tags --always --long)
$remote = (git config --get remote.origin.url)
Set-Content -Path "jellyfin_version.ini" -Value "commit=$commit`r`nrevision=$count`r`nbranch=$branch`r`ntagdesc=$desc`r`nremote=$remote"
Write-Host Updated build version in jellyfin_version.ini
Write-Host "commit=$commit`r`nrevision=$count`r`nbranch=$branch`r`ntagdesc=$desc`r`nremote=$remote`r`n"
} else {
Write-Host Did not update build version because there was no .git directory.
}

View File

@ -6,7 +6,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>

View File

@ -309,8 +309,7 @@ namespace MediaBrowser.Api.Session
DateCreated = DateTime.UtcNow, DateCreated = DateTime.UtcNow,
DeviceId = _appHost.SystemId, DeviceId = _appHost.SystemId,
DeviceName = _appHost.FriendlyName, DeviceName = _appHost.FriendlyName,
AppVersion = _appHost.ApplicationVersion.ToString() AppVersion = _appHost.ApplicationSemanticVersion
}); });
} }

View File

@ -71,6 +71,18 @@ namespace MediaBrowser.Common
/// <value>The application version.</value> /// <value>The application version.</value>
Version ApplicationVersion { get; } Version ApplicationVersion { get; }
/// <summary>
/// Gets the application semantic version.
/// </summary>
/// <value>The application semantic version.</value>
string ApplicationSemanticVersion { get; }
/// <summary>
/// Gets the application user agent.
/// </summary>
/// <value>The application user agent.</value>
string ApplicationUserAgent { get; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether this instance can self update. /// Gets or sets a value indicating whether this instance can self update.
/// </summary> /// </summary>

View File

@ -12,7 +12,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>

View File

@ -13,7 +13,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>

View File

@ -6,7 +6,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>

View File

@ -6,7 +6,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -17,11 +17,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Jellyfin.Versioning\Jellyfin.Versioning.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,5 +1,3 @@
using Jellyfin.Versioning;
namespace MediaBrowser.Model.System namespace MediaBrowser.Model.System
{ {
public class PublicSystemInfo public class PublicSystemInfo
@ -23,23 +21,11 @@ namespace MediaBrowser.Model.System
public string ServerName { get; set; } public string ServerName { get; set; }
/// <summary> /// <summary>
/// Gets or sets the API version. /// Gets or sets the server version.
/// </summary> /// </summary>
/// <value>The version.</value> /// <value>The version.</value>
public string Version { get; set; } public string Version { get; set; }
/// <summary>
/// Gets or sets the server version.
/// </summary>
/// <value>The server version.</value>
public string ServerVersion { get; set; }
/// <summary>
/// Gets or sets the build version.
/// </summary>
/// <value>The build version.</value>
public ExtendedVersion ExtendedVersion { get; set; }
/// <summary> /// <summary>
/// Gets or sets the operating sytem. /// Gets or sets the operating sytem.
/// </summary> /// </summary>

View File

@ -7,7 +7,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -424,7 +424,7 @@ namespace MediaBrowser.Providers.Movies
_lastRequestTicks = DateTime.UtcNow.Ticks; _lastRequestTicks = DateTime.UtcNow.Ticks;
options.BufferContent = true; options.BufferContent = true;
options.UserAgent = "Emby/" + _appHost.ApplicationVersion; options.UserAgent = _appHost.ApplicationUserAgent;
return await _httpClient.SendAsync(options, "GET").ConfigureAwait(false); return await _httpClient.SendAsync(options, "GET").ConfigureAwait(false);
} }

View File

@ -742,7 +742,7 @@ namespace MediaBrowser.Providers.Music
{ {
Url = url, Url = url,
CancellationToken = cancellationToken, CancellationToken = cancellationToken,
UserAgent = _appHost.Name + "/" + _appHost.ApplicationVersion, UserAgent = _appHost.ApplicationUserAgent,
BufferContent = throttleMs > 0 BufferContent = throttleMs > 0
}; };

View File

@ -205,7 +205,7 @@ namespace MediaBrowser.WebDashboard.Api
return _resultFactory.GetStaticResult(Request, plugin.Version.ToString().GetMD5(), null, null, MimeTypes.GetMimeType("page.html"), () => Task.FromResult(stream)); return _resultFactory.GetStaticResult(Request, plugin.Version.ToString().GetMD5(), null, null, MimeTypes.GetMimeType("page.html"), () => Task.FromResult(stream));
} }
return _resultFactory.GetStaticResult(Request, plugin.Version.ToString().GetMD5(), null, null, MimeTypes.GetMimeType("page.html"), () => GetPackageCreator(DashboardUIPath).ModifyHtml("dummy.html", stream, null, _appHost.ApplicationVersion.ToString(), null)); return _resultFactory.GetStaticResult(Request, plugin.Version.ToString().GetMD5(), null, null, MimeTypes.GetMimeType("page.html"), () => GetPackageCreator(DashboardUIPath).ModifyHtml("dummy.html", stream, null, _appHost.ApplicationSemanticVersion, null));
} }
throw new ResourceNotFoundException(); throw new ResourceNotFoundException();
@ -342,7 +342,7 @@ namespace MediaBrowser.WebDashboard.Api
cacheDuration = TimeSpan.FromDays(365); cacheDuration = TimeSpan.FromDays(365);
} }
var cacheKey = (_appHost.ApplicationVersion + (localizationCulture ?? string.Empty) + path).GetMD5(); var cacheKey = (_appHost.ApplicationSemanticVersion + (localizationCulture ?? string.Empty) + path).GetMD5();
// html gets modified on the fly // html gets modified on the fly
if (contentType.StartsWith("text/html", StringComparison.OrdinalIgnoreCase)) if (contentType.StartsWith("text/html", StringComparison.OrdinalIgnoreCase))
@ -364,7 +364,7 @@ namespace MediaBrowser.WebDashboard.Api
private Task<Stream> GetResourceStream(string basePath, string virtualPath, string localizationCulture) private Task<Stream> GetResourceStream(string basePath, string virtualPath, string localizationCulture)
{ {
return GetPackageCreator(basePath) return GetPackageCreator(basePath)
.GetResource(virtualPath, null, localizationCulture, _appHost.ApplicationVersion.ToString()); .GetResource(virtualPath, null, localizationCulture, _appHost.ApplicationSemanticVersion);
} }
private PackageCreator GetPackageCreator(string basePath) private PackageCreator GetPackageCreator(string basePath)
@ -400,7 +400,7 @@ namespace MediaBrowser.WebDashboard.Api
CopyDirectory(inputPath, targetPath); CopyDirectory(inputPath, targetPath);
} }
var appVersion = _appHost.ApplicationVersion.ToString(); var appVersion = _appHost.ApplicationSemanticVersion;
await DumpHtml(packageCreator, inputPath, targetPath, mode, appVersion); await DumpHtml(packageCreator, inputPath, targetPath, mode, appVersion);

View File

@ -6,7 +6,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>

View File

@ -1,4 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15 # Visual Studio 15
VisualStudioVersion = 15.0.26730.3 VisualStudioVersion = 15.0.26730.3
@ -58,10 +57,9 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{41093F42-C7CC-4D07-956B-6182CBEDE2EC}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{41093F42-C7CC-4D07-956B-6182CBEDE2EC}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig .editorconfig = .editorconfig
SharedVersion.cs = SharedVersion.cs
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Versioning", "Jellyfin.Versioning\Jellyfin.Versioning.csproj", "{F825B88C-4C87-4439-AE20-ACA12B6A9C83}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -172,10 +170,6 @@ Global
{07E39F42-A2C6-4B32-AF8C-725F957A73FF}.Debug|Any CPU.Build.0 = Debug|Any CPU {07E39F42-A2C6-4B32-AF8C-725F957A73FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07E39F42-A2C6-4B32-AF8C-725F957A73FF}.Release|Any CPU.ActiveCfg = Release|Any CPU {07E39F42-A2C6-4B32-AF8C-725F957A73FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{07E39F42-A2C6-4B32-AF8C-725F957A73FF}.Release|Any CPU.Build.0 = Release|Any CPU {07E39F42-A2C6-4B32-AF8C-725F957A73FF}.Release|Any CPU.Build.0 = Release|Any CPU
{F825B88C-4C87-4439-AE20-ACA12B6A9C83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F825B88C-4C87-4439-AE20-ACA12B6A9C83}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F825B88C-4C87-4439-AE20-ACA12B6A9C83}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F825B88C-4C87-4439-AE20-ACA12B6A9C83}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -184,12 +178,9 @@ Global
SolutionGuid = {3448830C-EBDC-426C-85CD-7BBB9651A7FE} SolutionGuid = {3448830C-EBDC-426C-85CD-7BBB9651A7FE}
EndGlobalSection EndGlobalSection
GlobalSection(AutomaticVersions) = postSolution GlobalSection(AutomaticVersions) = postSolution
PrimaryVersionType = AssemblyFileVersionAttribute
UpdateAssemblyVersion = True UpdateAssemblyVersion = True
UpdateAssemblyFileVersion = True UpdateAssemblyFileVersion = True
UpdateAssemblyInfoVersion = True UpdateAssemblyInfoVersion = True
ShouldCreateLogs = True
AdvancedSettingsExpanded = True
AssemblyVersionSettings = None.None.None.None AssemblyVersionSettings = None.None.None.None
AssemblyFileVersionSettings = None.None.None.None AssemblyFileVersionSettings = None.None.None.None
AssemblyInfoVersionSettings = None.None.None.None AssemblyInfoVersionSettings = None.None.None.None

View File

@ -6,7 +6,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>

View File

@ -20,5 +20,5 @@ using System.Runtime.InteropServices;
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("2019.1.20.3")]

View File

@ -20,5 +20,5 @@ using System.Runtime.InteropServices;
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("2019.1.20.3")]

View File

@ -6,7 +6,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Jellyfin.Versioning\SharedVersion.cs" /> <Compile Include="..\SharedVersion.cs" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>