mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-27 01:50:53 +01:00
Initial upload
This commit is contained in:
@@ -2,11 +2,16 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace MediaBrowser.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// Delegate used with GetExports{T}.
|
||||
/// </summary>
|
||||
/// <param name="type">Type to create.</param>
|
||||
/// <returns>New instance of type <param>type</param>.</returns>
|
||||
public delegate object CreationDelegate(Type type);
|
||||
|
||||
/// <summary>
|
||||
/// An interface to be implemented by the applications hosting a kernel.
|
||||
/// </summary>
|
||||
@@ -53,6 +58,11 @@ namespace MediaBrowser.Common
|
||||
/// <value>The application version.</value>
|
||||
Version ApplicationVersion { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the service provider.
|
||||
/// </summary>
|
||||
IServiceProvider ServiceProvider { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the application version.
|
||||
/// </summary>
|
||||
@@ -71,12 +81,6 @@ namespace MediaBrowser.Common
|
||||
/// </summary>
|
||||
string ApplicationUserAgentAddress { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the plugins.
|
||||
/// </summary>
|
||||
/// <value>The plugins.</value>
|
||||
IReadOnlyList<IPlugin> Plugins { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets all plugin assemblies which implement a custom rest api.
|
||||
/// </summary>
|
||||
@@ -101,6 +105,22 @@ namespace MediaBrowser.Common
|
||||
/// <returns><see cref="IReadOnlyCollection{T}" />.</returns>
|
||||
IReadOnlyCollection<T> GetExports<T>(bool manageLifetime = true);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the exports.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type.</typeparam>
|
||||
/// <param name="defaultFunc">Delegate function that gets called to create the object.</param>
|
||||
/// <param name="manageLifetime">If set to <c>true</c> [manage lifetime].</param>
|
||||
/// <returns><see cref="IReadOnlyCollection{T}" />.</returns>
|
||||
IReadOnlyCollection<T> GetExports<T>(CreationDelegate defaultFunc, bool manageLifetime = true);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the export types.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type.</typeparam>
|
||||
/// <returns>IEnumerable{Type}.</returns>
|
||||
IEnumerable<Type> GetExportTypes<T>();
|
||||
|
||||
/// <summary>
|
||||
/// Resolves this instance.
|
||||
/// </summary>
|
||||
@@ -114,12 +134,6 @@ namespace MediaBrowser.Common
|
||||
/// <returns>A task.</returns>
|
||||
Task Shutdown();
|
||||
|
||||
/// <summary>
|
||||
/// Removes the plugin.
|
||||
/// </summary>
|
||||
/// <param name="plugin">The plugin.</param>
|
||||
void RemovePlugin(IPlugin plugin);
|
||||
|
||||
/// <summary>
|
||||
/// Initializes this instance.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,7 +7,6 @@ using System.Runtime.InteropServices;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Model.Plugins;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace MediaBrowser.Common.Plugins
|
||||
{
|
||||
@@ -64,14 +63,12 @@ namespace MediaBrowser.Common.Plugins
|
||||
/// <returns>PluginInfo.</returns>
|
||||
public virtual PluginInfo GetPluginInfo()
|
||||
{
|
||||
var info = new PluginInfo
|
||||
{
|
||||
Name = Name,
|
||||
Version = Version.ToString(),
|
||||
Description = Description,
|
||||
Id = Id.ToString(),
|
||||
CanUninstall = CanUninstall
|
||||
};
|
||||
var info = new PluginInfo(
|
||||
Name,
|
||||
Version,
|
||||
Description,
|
||||
Id,
|
||||
CanUninstall);
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
33
MediaBrowser.Common/Plugins/IHasPluginConfiguration.cs
Normal file
33
MediaBrowser.Common/Plugins/IHasPluginConfiguration.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using MediaBrowser.Model.Plugins;
|
||||
|
||||
namespace MediaBrowser.Common.Plugins
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the <see cref="IHasPluginConfiguration" />.
|
||||
/// </summary>
|
||||
public interface IHasPluginConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the type of configuration this plugin uses.
|
||||
/// </summary>
|
||||
Type ConfigurationType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the plugin's configuration.
|
||||
/// </summary>
|
||||
BasePluginConfiguration Configuration { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Completely overwrites the current configuration with a new copy.
|
||||
/// </summary>
|
||||
/// <param name="configuration">The configuration.</param>
|
||||
void UpdateConfiguration(BasePluginConfiguration configuration);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the startup directory creation function.
|
||||
/// </summary>
|
||||
/// <param name="directoryCreateFn">The directory function used to create the configuration folder.</param>
|
||||
void SetStartupInfo(Action<string> directoryCreateFn);
|
||||
}
|
||||
}
|
||||
@@ -1,44 +1,36 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using MediaBrowser.Model.Plugins;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace MediaBrowser.Common.Plugins
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface IPlugin.
|
||||
/// Defines the <see cref="IPlugin" />.
|
||||
/// </summary>
|
||||
public interface IPlugin
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name of the plugin.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the description.
|
||||
/// Gets the Description.
|
||||
/// </summary>
|
||||
/// <value>The description.</value>
|
||||
string Description { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the unique id.
|
||||
/// </summary>
|
||||
/// <value>The unique id.</value>
|
||||
Guid Id { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the plugin version.
|
||||
/// </summary>
|
||||
/// <value>The version.</value>
|
||||
Version Version { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to the assembly file.
|
||||
/// </summary>
|
||||
/// <value>The assembly file path.</value>
|
||||
string AssemblyFilePath { get; }
|
||||
|
||||
/// <summary>
|
||||
@@ -49,11 +41,10 @@ namespace MediaBrowser.Common.Plugins
|
||||
/// <summary>
|
||||
/// Gets the full path to the data folder, where the plugin can store any miscellaneous files needed.
|
||||
/// </summary>
|
||||
/// <value>The data folder path.</value>
|
||||
string DataFolderPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the plugin info.
|
||||
/// Gets the <see cref="PluginInfo"/>.
|
||||
/// </summary>
|
||||
/// <returns>PluginInfo.</returns>
|
||||
PluginInfo GetPluginInfo();
|
||||
@@ -63,29 +54,4 @@ namespace MediaBrowser.Common.Plugins
|
||||
/// </summary>
|
||||
void OnUninstalling();
|
||||
}
|
||||
|
||||
public interface IHasPluginConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the type of configuration this plugin uses.
|
||||
/// </summary>
|
||||
/// <value>The type of the configuration.</value>
|
||||
Type ConfigurationType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the plugin's configuration.
|
||||
/// </summary>
|
||||
/// <value>The configuration.</value>
|
||||
BasePluginConfiguration Configuration { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Completely overwrites the current configuration with a new copy
|
||||
/// Returns true or false indicating success or failure.
|
||||
/// </summary>
|
||||
/// <param name="configuration">The configuration.</param>
|
||||
/// <exception cref="ArgumentNullException"><c>configuration</c> is <c>null</c>.</exception>
|
||||
void UpdateConfiguration(BasePluginConfiguration configuration);
|
||||
|
||||
void SetStartupInfo(Action<string> directoryCreateFn);
|
||||
}
|
||||
}
|
||||
|
||||
86
MediaBrowser.Common/Plugins/IPluginManager.cs
Normal file
86
MediaBrowser.Common/Plugins/IPluginManager.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace MediaBrowser.Common.Plugins
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the <see cref="IPluginManager" />.
|
||||
/// </summary>
|
||||
public interface IPluginManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Plugins.
|
||||
/// </summary>
|
||||
IList<LocalPlugin> Plugins { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates the plugins.
|
||||
/// </summary>
|
||||
void CreatePlugins();
|
||||
|
||||
/// <summary>
|
||||
/// Returns all the assemblies.
|
||||
/// </summary>
|
||||
/// <returns>An IEnumerable{Assembly}.</returns>
|
||||
IEnumerable<Assembly> LoadAssemblies();
|
||||
|
||||
/// <summary>
|
||||
/// Registers the plugin's services with the DI.
|
||||
/// Note: DI is not yet instantiated yet.
|
||||
/// </summary>
|
||||
/// <param name="serviceCollection">A <see cref="ServiceCollection"/> instance.</param>
|
||||
void RegisterServices(IServiceCollection serviceCollection);
|
||||
|
||||
/// <summary>
|
||||
/// Saves the manifest back to disk.
|
||||
/// </summary>
|
||||
/// <param name="manifest">The <see cref="PluginManifest"/> to save.</param>
|
||||
/// <param name="path">The path where to save the manifest.</param>
|
||||
/// <returns>True if successful.</returns>
|
||||
bool SaveManifest(PluginManifest manifest, string path);
|
||||
|
||||
/// <summary>
|
||||
/// Imports plugin details from a folder.
|
||||
/// </summary>
|
||||
/// <param name="folder">Folder of the plugin.</param>
|
||||
void ImportPluginFrom(string folder);
|
||||
|
||||
/// <summary>
|
||||
/// Disable the plugin.
|
||||
/// </summary>
|
||||
/// <param name="assembly">The <see cref="Assembly"/> of the plug to disable.</param>
|
||||
void FailPlugin(Assembly assembly);
|
||||
|
||||
/// <summary>
|
||||
/// Disable the plugin.
|
||||
/// </summary>
|
||||
/// <param name="plugin">The <see cref="LocalPlugin"/> of the plug to disable.</param>
|
||||
void DisablePlugin(LocalPlugin plugin);
|
||||
|
||||
/// <summary>
|
||||
/// Enables the plugin, disabling all other versions.
|
||||
/// </summary>
|
||||
/// <param name="plugin">The <see cref="LocalPlugin"/> of the plug to disable.</param>
|
||||
void EnablePlugin(LocalPlugin plugin);
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to find the plugin with and id of <paramref name="id"/>.
|
||||
/// </summary>
|
||||
/// <param name="id">Id of plugin.</param>
|
||||
/// <param name="version">The version of the plugin to locate.</param>
|
||||
/// <param name="plugin">A <see cref="LocalPlugin"/> if found, otherwise null.</param>
|
||||
/// <returns>Boolean value signifying the success of the search.</returns>
|
||||
bool TryGetPlugin(Guid id, Version? version, out LocalPlugin? plugin);
|
||||
|
||||
/// <summary>
|
||||
/// Removes the plugin.
|
||||
/// </summary>
|
||||
/// <param name="plugin">The plugin.</param>
|
||||
/// <returns>Outcome of the operation.</returns>
|
||||
bool RemovePlugin(LocalPlugin plugin);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
using MediaBrowser.Model.Plugins;
|
||||
|
||||
namespace MediaBrowser.Common.Plugins
|
||||
{
|
||||
@@ -9,36 +12,48 @@ namespace MediaBrowser.Common.Plugins
|
||||
/// </summary>
|
||||
public class LocalPlugin : IEquatable<LocalPlugin>
|
||||
{
|
||||
private readonly bool _supported;
|
||||
private Version? _version;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LocalPlugin"/> class.
|
||||
/// </summary>
|
||||
/// <param name="id">The plugin id.</param>
|
||||
/// <param name="name">The plugin name.</param>
|
||||
/// <param name="version">The plugin version.</param>
|
||||
/// <param name="path">The plugin path.</param>
|
||||
public LocalPlugin(Guid id, string name, Version version, string path)
|
||||
/// <param name="isSupported"><b>True</b> if Jellyfin supports this version of the plugin.</param>
|
||||
/// <param name="manifest">The manifest record for this plugin, or null if one does not exist.</param>
|
||||
public LocalPlugin(string path, bool isSupported, PluginManifest manifest)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
Version = version;
|
||||
Path = path;
|
||||
DllFiles = new List<string>();
|
||||
_supported = isSupported;
|
||||
Manifest = manifest;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the plugin id.
|
||||
/// </summary>
|
||||
public Guid Id { get; }
|
||||
public Guid Id => Manifest.Guid;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the plugin name.
|
||||
/// </summary>
|
||||
public string Name { get; }
|
||||
public string Name => Manifest.Name;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the plugin version.
|
||||
/// </summary>
|
||||
public Version Version { get; }
|
||||
public Version Version
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_version == null)
|
||||
{
|
||||
_version = Version.Parse(Manifest.Version);
|
||||
}
|
||||
|
||||
return _version;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the plugin path.
|
||||
@@ -51,26 +66,24 @@ namespace MediaBrowser.Common.Plugins
|
||||
public List<string> DllFiles { get; }
|
||||
|
||||
/// <summary>
|
||||
/// == operator.
|
||||
/// Gets or sets the instance of this plugin.
|
||||
/// </summary>
|
||||
/// <param name="left">Left item.</param>
|
||||
/// <param name="right">Right item.</param>
|
||||
/// <returns>Comparison result.</returns>
|
||||
public static bool operator ==(LocalPlugin left, LocalPlugin right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
public IPlugin? Instance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// != operator.
|
||||
/// Gets a value indicating whether Jellyfin supports this version of the plugin, and it's enabled.
|
||||
/// </summary>
|
||||
/// <param name="left">Left item.</param>
|
||||
/// <param name="right">Right item.</param>
|
||||
/// <returns>Comparison result.</returns>
|
||||
public static bool operator !=(LocalPlugin left, LocalPlugin right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
public bool IsEnabledAndSupported => _supported && Manifest.Status >= PluginStatus.Active;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the plugin has a manifest.
|
||||
/// </summary>
|
||||
public PluginManifest Manifest { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating the assembly of the plugin.
|
||||
/// </summary>
|
||||
public Assembly? Assembly { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compare two <see cref="LocalPlugin"/>.
|
||||
@@ -80,10 +93,15 @@ namespace MediaBrowser.Common.Plugins
|
||||
/// <returns>Comparison result.</returns>
|
||||
public static int Compare(LocalPlugin a, LocalPlugin b)
|
||||
{
|
||||
if (a == null || b == null)
|
||||
{
|
||||
throw new ArgumentNullException(a == null ? nameof(a) : nameof(b));
|
||||
}
|
||||
|
||||
var compare = string.Compare(a.Name, b.Name, true, CultureInfo.InvariantCulture);
|
||||
|
||||
// Id is not equal but name is.
|
||||
if (a.Id != b.Id && compare == 0)
|
||||
if (!a.Id.Equals(b.Id) && compare == 0)
|
||||
{
|
||||
compare = a.Id.CompareTo(b.Id);
|
||||
}
|
||||
@@ -91,8 +109,20 @@ namespace MediaBrowser.Common.Plugins
|
||||
return compare == 0 ? a.Version.CompareTo(b.Version) : compare;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the plugin information.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="PluginInfo"/> instance containing the information.</returns>
|
||||
public PluginInfo GetPluginInfo()
|
||||
{
|
||||
var inst = Instance?.GetPluginInfo() ?? new PluginInfo(Manifest.Name, Version, Manifest.Description, Manifest.Guid, true);
|
||||
inst.Status = Manifest.Status;
|
||||
inst.HasImage = !string.IsNullOrEmpty(Manifest.ImageUrl);
|
||||
return inst;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object obj)
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
return obj is LocalPlugin other && this.Equals(other);
|
||||
}
|
||||
@@ -104,16 +134,14 @@ namespace MediaBrowser.Common.Plugins
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool Equals(LocalPlugin other)
|
||||
public bool Equals(LocalPlugin? other)
|
||||
{
|
||||
// Do not use == or != for comparison as this class overrides the operators.
|
||||
if (object.ReferenceEquals(other, null))
|
||||
if (other == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return Name.Equals(other.Name, StringComparison.OrdinalIgnoreCase)
|
||||
&& Id.Equals(other.Id);
|
||||
return Name.Equals(other.Name, StringComparison.OrdinalIgnoreCase) && Id.Equals(other.Id) && Version.Equals(other.Version);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
85
MediaBrowser.Common/Plugins/PluginManifest.cs
Normal file
85
MediaBrowser.Common/Plugins/PluginManifest.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using MediaBrowser.Model.Plugins;
|
||||
|
||||
namespace MediaBrowser.Common.Plugins
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a Plugin manifest file.
|
||||
/// </summary>
|
||||
public class PluginManifest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the category of the plugin.
|
||||
/// </summary>
|
||||
public string Category { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the changelog information.
|
||||
/// </summary>
|
||||
public string Changelog { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the description of the plugin.
|
||||
/// </summary>
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Global Unique Identifier for the plugin.
|
||||
/// </summary>
|
||||
#pragma warning disable CA1720 // Identifier contains type name
|
||||
public Guid Guid { get; set; }
|
||||
#pragma warning restore CA1720 // Identifier contains type name
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Name of the plugin.
|
||||
/// </summary>
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an overview of the plugin.
|
||||
/// </summary>
|
||||
public string Overview { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the owner of the plugin.
|
||||
/// </summary>
|
||||
public string Owner { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the compatibility version for the plugin.
|
||||
/// </summary>
|
||||
public string TargetAbi { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the upper compatibility version for the plugin.
|
||||
/// </summary>
|
||||
public string MaxAbi { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the timestamp of the plugin.
|
||||
/// </summary>
|
||||
public DateTime Timestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Version number of the plugin.
|
||||
/// </summary>
|
||||
public string Version { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this plugin should be ignored.
|
||||
/// </summary>
|
||||
public PluginStatus Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this plugin should automatically update.
|
||||
/// </summary>
|
||||
public bool AutoUpdate { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this plugin has an image.
|
||||
/// Image must be located in the local plugin folder.
|
||||
/// </summary>
|
||||
public string? ImageUrl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma warning disable CS1591
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -9,6 +9,9 @@ using MediaBrowser.Model.Updates;
|
||||
|
||||
namespace MediaBrowser.Common.Updates
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the <see cref="IInstallationManager" />.
|
||||
/// </summary>
|
||||
public interface IInstallationManager : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
@@ -21,12 +24,13 @@ namespace MediaBrowser.Common.Updates
|
||||
/// </summary>
|
||||
/// <param name="manifestName">Name of the repository.</param>
|
||||
/// <param name="manifest">The URL to query.</param>
|
||||
/// <param name="filterIncompatible">Filter out incompatible plugins.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{IReadOnlyList{PackageInfo}}.</returns>
|
||||
Task<IList<PackageInfo>> GetPackages(string manifestName, string manifest, CancellationToken cancellationToken = default);
|
||||
Task<IList<PackageInfo>> GetPackages(string manifestName, string manifest, bool filterIncompatible, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all available packages.
|
||||
/// Gets all available packages that are supported by this version.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{IReadOnlyList{PackageInfo}}.</returns>
|
||||
@@ -42,9 +46,11 @@ namespace MediaBrowser.Common.Updates
|
||||
/// <returns>All plugins matching the requirements.</returns>
|
||||
IEnumerable<PackageInfo> FilterPackages(
|
||||
IEnumerable<PackageInfo> availablePackages,
|
||||
string name = null,
|
||||
Guid guid = default,
|
||||
Version specificVersion = null);
|
||||
string? name = null,
|
||||
#pragma warning disable CA1720 // Identifier contains type name
|
||||
Guid? guid = default,
|
||||
#pragma warning restore CA1720 // Identifier contains type name
|
||||
Version? specificVersion = null);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all compatible versions ordered from newest to oldest.
|
||||
@@ -57,13 +63,15 @@ namespace MediaBrowser.Common.Updates
|
||||
/// <returns>All compatible versions ordered from newest to oldest.</returns>
|
||||
IEnumerable<InstallationInfo> GetCompatibleVersions(
|
||||
IEnumerable<PackageInfo> availablePackages,
|
||||
string name = null,
|
||||
Guid guid = default,
|
||||
Version minVersion = null,
|
||||
Version specificVersion = null);
|
||||
string? name = null,
|
||||
#pragma warning disable CA1720 // Identifier contains type name
|
||||
Guid? guid = default,
|
||||
#pragma warning restore CA1720 // Identifier contains type name
|
||||
Version? minVersion = null,
|
||||
Version? specificVersion = null);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the available plugin updates.
|
||||
/// Returns the available compatible plugin updates.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>The available plugin updates.</returns>
|
||||
@@ -81,7 +89,7 @@ namespace MediaBrowser.Common.Updates
|
||||
/// Uninstalls a plugin.
|
||||
/// </summary>
|
||||
/// <param name="plugin">The plugin.</param>
|
||||
void UninstallPlugin(IPlugin plugin);
|
||||
void UninstallPlugin(LocalPlugin plugin);
|
||||
|
||||
/// <summary>
|
||||
/// Cancels the installation.
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using MediaBrowser.Model.Updates;
|
||||
|
||||
namespace MediaBrowser.Common.Updates
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the <see cref="InstallationEventArgs" />.
|
||||
/// </summary>
|
||||
public class InstallationEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="InstallationInfo"/>.
|
||||
/// </summary>
|
||||
public InstallationInfo InstallationInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="VersionInfo"/>.
|
||||
/// </summary>
|
||||
public VersionInfo VersionInfo { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user