jellyfin/MediaBrowser.Model/Updates/VersionInfo.cs

78 lines
2.3 KiB
C#
Raw Normal View History

using System.Text.Json.Serialization;
2020-12-06 23:48:54 +00:00
using SysVersion = System.Version;
namespace MediaBrowser.Model.Updates
{
/// <summary>
/// Defines the <see cref="VersionInfo"/> class.
/// </summary>
public class VersionInfo
{
2020-12-06 23:48:54 +00:00
private SysVersion? _version;
2020-11-19 13:34:09 +00:00
/// <summary>
/// Gets or sets the version.
/// </summary>
/// <value>The version.</value>
[JsonPropertyName("version")]
2020-12-06 23:48:54 +00:00
public string Version
2020-11-19 13:34:09 +00:00
{
2022-12-05 14:00:20 +00:00
get => _version is null ? string.Empty : _version.ToString();
2020-11-19 13:34:09 +00:00
2020-12-06 23:48:54 +00:00
set => _version = SysVersion.Parse(value);
2020-11-19 13:34:09 +00:00
}
/// <summary>
2020-12-06 23:48:54 +00:00
/// Gets the version as a <see cref="SysVersion"/>.
2020-11-19 13:34:09 +00:00
/// </summary>
2020-12-06 23:48:54 +00:00
public SysVersion VersionNumber => _version ?? new SysVersion(0, 0, 0);
/// <summary>
/// Gets or sets the changelog for this version.
/// </summary>
/// <value>The changelog.</value>
[JsonPropertyName("changelog")]
2020-12-06 23:48:54 +00:00
public string? Changelog { get; set; }
/// <summary>
2020-04-11 10:54:33 +00:00
/// Gets or sets the ABI that this version was built against.
/// </summary>
2020-04-11 10:54:33 +00:00
/// <value>The target ABI version.</value>
[JsonPropertyName("targetAbi")]
2020-12-06 23:48:54 +00:00
public string? TargetAbi { get; set; }
/// <summary>
/// Gets or sets the source URL.
/// </summary>
/// <value>The source URL.</value>
[JsonPropertyName("sourceUrl")]
2020-12-06 23:48:54 +00:00
public string? SourceUrl { get; set; }
/// <summary>
/// Gets or sets a checksum for the binary.
/// </summary>
/// <value>The checksum.</value>
[JsonPropertyName("checksum")]
2020-12-06 23:48:54 +00:00
public string? Checksum { get; set; }
/// <summary>
/// Gets or sets a timestamp of when the binary was built.
/// </summary>
/// <value>The timestamp.</value>
[JsonPropertyName("timestamp")]
2020-12-06 23:48:54 +00:00
public string? Timestamp { get; set; }
2020-11-19 13:34:09 +00:00
/// <summary>
/// Gets or sets the repository name.
/// </summary>
[JsonPropertyName("repositoryName")]
2020-12-06 23:48:54 +00:00
public string RepositoryName { get; set; } = string.Empty;
2020-11-19 13:34:09 +00:00
/// <summary>
/// Gets or sets the repository url.
/// </summary>
[JsonPropertyName("repositoryUrl")]
2020-12-06 23:48:54 +00:00
public string RepositoryUrl { get; set; } = string.Empty;
}
}