PackageVersionInfo.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. using System;
  2. using MediaBrowser.Model.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. [IgnoreDataMember]
  35. public Version version
  36. {
  37. get { return _version ?? (_version = new Version(ValueOrDefault(versionStr, "0.0.0.1"))); }
  38. }
  39. /// <summary>
  40. /// Values the or default.
  41. /// </summary>
  42. /// <param name="str">The STR.</param>
  43. /// <param name="def">The def.</param>
  44. /// <returns>System.String.</returns>
  45. private static string ValueOrDefault(string str, string def)
  46. {
  47. return string.IsNullOrEmpty(str) ? def : str;
  48. }
  49. /// <summary>
  50. /// Gets or sets the classification.
  51. /// </summary>
  52. /// <value>The classification.</value>
  53. public PackageVersionClass classification { get; set; }
  54. /// <summary>
  55. /// Gets or sets the description.
  56. /// </summary>
  57. /// <value>The description.</value>
  58. public string description { get; set; }
  59. /// <summary>
  60. /// Gets or sets the required version STR.
  61. /// </summary>
  62. /// <value>The required version STR.</value>
  63. public string requiredVersionStr { get; set; }
  64. /// <summary>
  65. /// Gets or sets the source URL.
  66. /// </summary>
  67. /// <value>The source URL.</value>
  68. public string sourceUrl { get; set; }
  69. /// <summary>
  70. /// Gets or sets the source URL.
  71. /// </summary>
  72. /// <value>The source URL.</value>
  73. public string checksum { get; set; }
  74. /// <summary>
  75. /// Gets or sets the target filename.
  76. /// </summary>
  77. /// <value>The target filename.</value>
  78. public string targetFilename { get; set; }
  79. public string infoUrl { get; set; }
  80. public string runtimes { get; set; }
  81. }
  82. }