PackageVersionInfo.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using System;
  2. using System.Text.Json.Serialization;
  3. namespace MediaBrowser.Model.Updates
  4. {
  5. /// <summary>
  6. /// Class PackageVersionInfo
  7. /// </summary>
  8. public class PackageVersionInfo
  9. {
  10. /// <summary>
  11. /// Gets or sets the name.
  12. /// </summary>
  13. /// <value>The name.</value>
  14. public string name { get; set; }
  15. /// <summary>
  16. /// Gets or sets the guid.
  17. /// </summary>
  18. /// <value>The guid.</value>
  19. public string guid { get; set; }
  20. /// <summary>
  21. /// Gets or sets the version STR.
  22. /// </summary>
  23. /// <value>The version STR.</value>
  24. public string versionStr { get; set; }
  25. /// <summary>
  26. /// The _version
  27. /// </summary>
  28. private Version _version;
  29. /// <summary>
  30. /// Gets or sets the version.
  31. /// Had to make this an interpreted property since Protobuf can't handle Version
  32. /// </summary>
  33. /// <value>The version.</value>
  34. [JsonIgnore]
  35. public Version Version
  36. {
  37. get
  38. {
  39. if (_version == null)
  40. {
  41. var ver = versionStr;
  42. _version = new Version(string.IsNullOrEmpty(ver) ? "0.0.0.1" : ver);
  43. }
  44. return _version;
  45. }
  46. }
  47. /// <summary>
  48. /// Gets or sets the classification.
  49. /// </summary>
  50. /// <value>The classification.</value>
  51. public PackageVersionClass classification { get; set; }
  52. /// <summary>
  53. /// Gets or sets the description.
  54. /// </summary>
  55. /// <value>The description.</value>
  56. public string description { get; set; }
  57. /// <summary>
  58. /// Gets or sets the required version STR.
  59. /// </summary>
  60. /// <value>The required version STR.</value>
  61. public string requiredVersionStr { get; set; }
  62. /// <summary>
  63. /// Gets or sets the source URL.
  64. /// </summary>
  65. /// <value>The source URL.</value>
  66. public string sourceUrl { get; set; }
  67. /// <summary>
  68. /// Gets or sets the source URL.
  69. /// </summary>
  70. /// <value>The source URL.</value>
  71. public string checksum { get; set; }
  72. /// <summary>
  73. /// Gets or sets the target filename.
  74. /// </summary>
  75. /// <value>The target filename.</value>
  76. public string targetFilename { get; set; }
  77. public string infoUrl { get; set; }
  78. public string runtimes { get; set; }
  79. }
  80. }