aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Plugins
diff options
context:
space:
mode:
authorGreenback <jimcartlidge@yahoo.co.uk>2020-12-06 23:48:54 +0000
committerGreenback <jimcartlidge@yahoo.co.uk>2020-12-14 16:14:39 +0000
commit7986465cf785ca385fd1765326887e550bced033 (patch)
tree8859e9b336326081b9dfdc8d550d7f7d6d6652b7 /MediaBrowser.Model/Plugins
parentf2c2beca0f9a249edd7cc967c328d32ebdc30092 (diff)
Initial upload
Diffstat (limited to 'MediaBrowser.Model/Plugins')
-rw-r--r--MediaBrowser.Model/Plugins/PluginInfo.cs39
-rw-r--r--MediaBrowser.Model/Plugins/PluginStatus.cs17
2 files changed, 46 insertions, 10 deletions
diff --git a/MediaBrowser.Model/Plugins/PluginInfo.cs b/MediaBrowser.Model/Plugins/PluginInfo.cs
index dd215192f9..52c99b9c3e 100644
--- a/MediaBrowser.Model/Plugins/PluginInfo.cs
+++ b/MediaBrowser.Model/Plugins/PluginInfo.cs
@@ -1,4 +1,7 @@
-#nullable disable
+#nullable enable
+
+using System;
+
namespace MediaBrowser.Model.Plugins
{
/// <summary>
@@ -7,33 +10,45 @@ namespace MediaBrowser.Model.Plugins
public class PluginInfo
{
/// <summary>
+ /// Initializes a new instance of the <see cref="PluginInfo"/> class.
+ /// </summary>
+ /// <param name="name">The plugin name.</param>
+ /// <param name="version">The plugin <see cref="Version"/>.</param>
+ /// <param name="description">The plugin description.</param>
+ /// <param name="id">The <see cref="Guid"/>.</param>
+ /// <param name="canUninstall">True if this plugin can be uninstalled.</param>
+ public PluginInfo(string name, Version version, string description, Guid id, bool canUninstall)
+ {
+ Name = name;
+ Version = version?.ToString() ?? throw new ArgumentNullException(nameof(version));
+ Description = description;
+ Id = id.ToString();
+ CanUninstall = canUninstall;
+ }
+
+ /// <summary>
/// Gets or sets the name.
/// </summary>
- /// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the version.
/// </summary>
- /// <value>The version.</value>
public string Version { get; set; }
/// <summary>
/// Gets or sets the name of the configuration file.
/// </summary>
- /// <value>The name of the configuration file.</value>
- public string ConfigurationFileName { get; set; }
+ public string? ConfigurationFileName { get; set; }
/// <summary>
/// Gets or sets the description.
/// </summary>
- /// <value>The description.</value>
public string Description { get; set; }
/// <summary>
/// Gets or sets the unique id.
/// </summary>
- /// <value>The unique id.</value>
public string Id { get; set; }
/// <summary>
@@ -42,9 +57,13 @@ namespace MediaBrowser.Model.Plugins
public bool CanUninstall { get; set; }
/// <summary>
- /// Gets or sets the image URL.
+ /// Gets or sets a value indicating whether this plugin has a valid image.
+ /// </summary>
+ public bool HasImage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating the status of the plugin.
/// </summary>
- /// <value>The image URL.</value>
- public string ImageUrl { get; set; }
+ public PluginStatus Status { get; set; }
}
}
diff --git a/MediaBrowser.Model/Plugins/PluginStatus.cs b/MediaBrowser.Model/Plugins/PluginStatus.cs
new file mode 100644
index 0000000000..439968ba8a
--- /dev/null
+++ b/MediaBrowser.Model/Plugins/PluginStatus.cs
@@ -0,0 +1,17 @@
+#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
+#pragma warning disable SA1602 // Enumeration items should be documented
+namespace MediaBrowser.Model.Plugins
+{
+ /// <summary>
+ /// Plugin load status.
+ /// </summary>
+ public enum PluginStatus
+ {
+ RestartRequired = 1,
+ Active = 0,
+ Disabled = -1,
+ NotSupported = -2,
+ Malfunction = -3,
+ Superceded = -4
+ }
+}