| | | 1 | | using System.Text.Json.Serialization; |
| | | 2 | | using SysVersion = System.Version; |
| | | 3 | | |
| | | 4 | | namespace MediaBrowser.Model.Updates |
| | | 5 | | { |
| | | 6 | | /// <summary> |
| | | 7 | | /// Defines the <see cref="VersionInfo"/> class. |
| | | 8 | | /// </summary> |
| | | 9 | | public class VersionInfo |
| | | 10 | | { |
| | | 11 | | private SysVersion? _version; |
| | | 12 | | |
| | | 13 | | /// <summary> |
| | | 14 | | /// Gets or sets the version. |
| | | 15 | | /// </summary> |
| | | 16 | | /// <value>The version.</value> |
| | | 17 | | [JsonPropertyName("version")] |
| | | 18 | | public string Version |
| | | 19 | | { |
| | 10 | 20 | | get => _version is null ? string.Empty : _version.ToString(); |
| | | 21 | | |
| | 424 | 22 | | set => _version = SysVersion.Parse(value); |
| | | 23 | | } |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// Gets the version as a <see cref="SysVersion"/>. |
| | | 27 | | /// </summary> |
| | 258 | 28 | | public SysVersion VersionNumber => _version ?? new SysVersion(0, 0, 0); |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// Gets or sets the changelog for this version. |
| | | 32 | | /// </summary> |
| | | 33 | | /// <value>The changelog.</value> |
| | | 34 | | [JsonPropertyName("changelog")] |
| | | 35 | | public string? Changelog { get; set; } |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// Gets or sets the ABI that this version was built against. |
| | | 39 | | /// </summary> |
| | | 40 | | /// <value>The target ABI version.</value> |
| | | 41 | | [JsonPropertyName("targetAbi")] |
| | | 42 | | public string? TargetAbi { get; set; } |
| | | 43 | | |
| | | 44 | | /// <summary> |
| | | 45 | | /// Gets or sets the source URL. |
| | | 46 | | /// </summary> |
| | | 47 | | /// <value>The source URL.</value> |
| | | 48 | | [JsonPropertyName("sourceUrl")] |
| | | 49 | | public string? SourceUrl { get; set; } |
| | | 50 | | |
| | | 51 | | /// <summary> |
| | | 52 | | /// Gets or sets a checksum for the binary. |
| | | 53 | | /// </summary> |
| | | 54 | | /// <value>The checksum.</value> |
| | | 55 | | [JsonPropertyName("checksum")] |
| | | 56 | | public string? Checksum { get; set; } |
| | | 57 | | |
| | | 58 | | /// <summary> |
| | | 59 | | /// Gets or sets a timestamp of when the binary was built. |
| | | 60 | | /// </summary> |
| | | 61 | | /// <value>The timestamp.</value> |
| | | 62 | | [JsonPropertyName("timestamp")] |
| | | 63 | | public string? Timestamp { get; set; } |
| | | 64 | | |
| | | 65 | | /// <summary> |
| | | 66 | | /// Gets or sets the repository name. |
| | | 67 | | /// </summary> |
| | | 68 | | [JsonPropertyName("repositoryName")] |
| | | 69 | | public string RepositoryName { get; set; } = string.Empty; |
| | | 70 | | |
| | | 71 | | /// <summary> |
| | | 72 | | /// Gets or sets the repository url. |
| | | 73 | | /// </summary> |
| | | 74 | | [JsonPropertyName("repositoryUrl")] |
| | | 75 | | public string RepositoryUrl { get; set; } = string.Empty; |
| | | 76 | | } |
| | | 77 | | } |