PluginManifest.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text.Json.Serialization;
  4. using MediaBrowser.Model.Plugins;
  5. namespace MediaBrowser.Common.Plugins
  6. {
  7. /// <summary>
  8. /// Defines a Plugin manifest file.
  9. /// </summary>
  10. public class PluginManifest
  11. {
  12. /// <summary>
  13. /// Initializes a new instance of the <see cref="PluginManifest"/> class.
  14. /// </summary>
  15. public PluginManifest()
  16. {
  17. Category = string.Empty;
  18. Changelog = string.Empty;
  19. Description = string.Empty;
  20. Id = Guid.Empty;
  21. Name = string.Empty;
  22. Owner = string.Empty;
  23. Overview = string.Empty;
  24. TargetAbi = string.Empty;
  25. Version = string.Empty;
  26. Assemblies = Array.Empty<string>();
  27. }
  28. /// <summary>
  29. /// Gets or sets the category of the plugin.
  30. /// </summary>
  31. [JsonPropertyName("category")]
  32. public string Category { get; set; }
  33. /// <summary>
  34. /// Gets or sets the changelog information.
  35. /// </summary>
  36. [JsonPropertyName("changelog")]
  37. public string Changelog { get; set; }
  38. /// <summary>
  39. /// Gets or sets the description of the plugin.
  40. /// </summary>
  41. [JsonPropertyName("description")]
  42. public string Description { get; set; }
  43. /// <summary>
  44. /// Gets or sets the Global Unique Identifier for the plugin.
  45. /// </summary>
  46. [JsonPropertyName("guid")]
  47. public Guid Id { get; set; }
  48. /// <summary>
  49. /// Gets or sets the Name of the plugin.
  50. /// </summary>
  51. [JsonPropertyName("name")]
  52. public string Name { get; set; }
  53. /// <summary>
  54. /// Gets or sets an overview of the plugin.
  55. /// </summary>
  56. [JsonPropertyName("overview")]
  57. public string Overview { get; set; }
  58. /// <summary>
  59. /// Gets or sets the owner of the plugin.
  60. /// </summary>
  61. [JsonPropertyName("owner")]
  62. public string Owner { get; set; }
  63. /// <summary>
  64. /// Gets or sets the compatibility version for the plugin.
  65. /// </summary>
  66. [JsonPropertyName("targetAbi")]
  67. public string TargetAbi { get; set; }
  68. /// <summary>
  69. /// Gets or sets the timestamp of the plugin.
  70. /// </summary>
  71. [JsonPropertyName("timestamp")]
  72. public DateTime Timestamp { get; set; }
  73. /// <summary>
  74. /// Gets or sets the Version number of the plugin.
  75. /// </summary>
  76. [JsonPropertyName("version")]
  77. public string Version { get; set; }
  78. /// <summary>
  79. /// Gets or sets a value indicating the operational status of this plugin.
  80. /// </summary>
  81. [JsonPropertyName("status")]
  82. public PluginStatus Status { get; set; }
  83. /// <summary>
  84. /// Gets or sets a value indicating whether this plugin should automatically update.
  85. /// </summary>
  86. [JsonPropertyName("autoUpdate")]
  87. public bool AutoUpdate { get; set; } = true; // DO NOT MOVE THIS INTO THE CONSTRUCTOR.
  88. /// <summary>
  89. /// Gets or sets the ImagePath
  90. /// Gets or sets a value indicating whether this plugin has an image.
  91. /// Image must be located in the local plugin folder.
  92. /// </summary>
  93. [JsonPropertyName("imagePath")]
  94. public string? ImagePath { get; set; }
  95. /// <summary>
  96. /// Gets or sets the collection of assemblies that should be loaded.
  97. /// Paths are considered relative to the plugin folder.
  98. /// </summary>
  99. [JsonPropertyName("assemblies")]
  100. public IReadOnlyList<string> Assemblies { get; set; }
  101. }
  102. }