2020-12-15 18:27:31 +00:00
|
|
|
using System.Text.Json.Serialization;
|
2020-12-06 23:48:54 +00:00
|
|
|
using SysVersion = System.Version;
|
2020-02-25 16:58:39 +00:00
|
|
|
|
|
|
|
namespace MediaBrowser.Model.Updates
|
|
|
|
{
|
|
|
|
/// <summary>
|
2020-12-15 18:27:31 +00:00
|
|
|
/// Defines the <see cref="VersionInfo"/> class.
|
2020-02-25 16:58:39 +00:00
|
|
|
/// </summary>
|
|
|
|
public class VersionInfo
|
|
|
|
{
|
2020-12-06 23:48:54 +00:00
|
|
|
private SysVersion? _version;
|
2020-11-19 13:34:09 +00:00
|
|
|
|
2020-02-25 16:58:39 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the version.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The version.</value>
|
2020-12-15 18:27:31 +00:00
|
|
|
[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);
|
2020-02-25 16:58:39 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2020-04-11 10:56:42 +00:00
|
|
|
/// Gets or sets the changelog for this version.
|
2020-02-25 16:58:39 +00:00
|
|
|
/// </summary>
|
2020-04-11 10:56:42 +00:00
|
|
|
/// <value>The changelog.</value>
|
2020-12-15 18:27:31 +00:00
|
|
|
[JsonPropertyName("changelog")]
|
2020-12-06 23:48:54 +00:00
|
|
|
public string? Changelog { get; set; }
|
2020-02-25 16:58:39 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2020-04-11 10:54:33 +00:00
|
|
|
/// Gets or sets the ABI that this version was built against.
|
2020-02-25 16:58:39 +00:00
|
|
|
/// </summary>
|
2020-04-11 10:54:33 +00:00
|
|
|
/// <value>The target ABI version.</value>
|
2020-12-15 18:27:31 +00:00
|
|
|
[JsonPropertyName("targetAbi")]
|
2020-12-06 23:48:54 +00:00
|
|
|
public string? TargetAbi { get; set; }
|
|
|
|
|
2020-02-25 16:58:39 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the source URL.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The source URL.</value>
|
2020-12-15 18:27:31 +00:00
|
|
|
[JsonPropertyName("sourceUrl")]
|
2020-12-06 23:48:54 +00:00
|
|
|
public string? SourceUrl { get; set; }
|
2020-02-25 16:58:39 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets a checksum for the binary.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The checksum.</value>
|
2020-12-15 18:27:31 +00:00
|
|
|
[JsonPropertyName("checksum")]
|
2020-12-06 23:48:54 +00:00
|
|
|
public string? Checksum { get; set; }
|
2020-05-24 07:59:05 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets a timestamp of when the binary was built.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The timestamp.</value>
|
2020-12-15 18:27:31 +00:00
|
|
|
[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>
|
2020-12-15 18:27:31 +00:00
|
|
|
[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>
|
2020-12-15 18:27:31 +00:00
|
|
|
[JsonPropertyName("repositoryUrl")]
|
2020-12-06 23:48:54 +00:00
|
|
|
public string RepositoryUrl { get; set; } = string.Empty;
|
2020-02-25 16:58:39 +00:00
|
|
|
}
|
|
|
|
}
|