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