You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.Common/Updates/IInstallationManager.cs

96 lines
4.1 KiB

using System;
6 years ago
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Model.Updates;
6 years ago
namespace MediaBrowser.Common.Updates
{
4 years ago
/// <summary>
/// Defines the <see cref="IInstallationManager" />.
/// </summary>
6 years ago
public interface IInstallationManager : IDisposable
{
/// <summary>
/// Gets the completed installations.
6 years ago
/// </summary>
IEnumerable<InstallationInfo> CompletedInstallations { get; }
6 years ago
/// <summary>
/// Parses a plugin manifest at the supplied URL.
/// </summary>
/// <param name="manifestName">Name of the repository.</param>
/// <param name="manifest">The URL to query.</param>
4 years ago
/// <param name="filterIncompatible">Filter out incompatible plugins.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{IReadOnlyList{PackageInfo}}.</returns>
4 years ago
Task<PackageInfo[]> GetPackages(string manifestName, string manifest, bool filterIncompatible, CancellationToken cancellationToken = default);
6 years ago
/// <summary>
4 years ago
/// Gets all available packages that are supported by this version.
6 years ago
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{IReadOnlyList{PackageInfo}}.</returns>
Task<IReadOnlyList<PackageInfo>> GetAvailablePackages(CancellationToken cancellationToken = default);
6 years ago
/// <summary>
/// Returns all plugins matching the requirements.
6 years ago
/// </summary>
/// <param name="availablePackages">The available packages.</param>
/// <param name="name">The name of the plugin.</param>
/// <param name="id">The id of the plugin.</param>
/// <param name="specificVersion">The version of the plugin.</param>
/// <returns>All plugins matching the requirements.</returns>
IEnumerable<PackageInfo> FilterPackages(
IEnumerable<PackageInfo> availablePackages,
4 years ago
string? name = null,
4 years ago
Guid id = default,
4 years ago
Version? specificVersion = null);
6 years ago
/// <summary>
/// Returns all compatible versions ordered from newest to oldest.
6 years ago
/// </summary>
/// <param name="availablePackages">The available packages.</param>
/// <param name="name">The name.</param>
/// <param name="id">The id of the plugin.</param>
/// <param name="minVersion">The minimum required version of the plugin.</param>
/// <param name="specificVersion">The specific version of the plugin to install.</param>
/// <returns>All compatible versions ordered from newest to oldest.</returns>
IEnumerable<InstallationInfo> GetCompatibleVersions(
IEnumerable<PackageInfo> availablePackages,
4 years ago
string? name = null,
4 years ago
Guid id = default,
4 years ago
Version? minVersion = null,
Version? specificVersion = null);
6 years ago
/// <summary>
4 years ago
/// Returns the available compatible plugin updates.
6 years ago
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The available plugin updates.</returns>
Task<IEnumerable<InstallationInfo>> GetAvailablePluginUpdates(CancellationToken cancellationToken = default);
6 years ago
/// <summary>
/// Installs the package.
/// </summary>
/// <param name="package">The package.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns><see cref="Task" />.</returns>
Task InstallPackage(InstallationInfo package, CancellationToken cancellationToken = default);
6 years ago
/// <summary>
/// Uninstalls a plugin.
6 years ago
/// </summary>
/// <param name="plugin">The plugin.</param>
4 years ago
void UninstallPlugin(LocalPlugin plugin);
/// <summary>
/// Cancels the installation.
/// </summary>
/// <param name="id">The id of the package that is being installed.</param>
/// <returns>Returns true if the install was cancelled.</returns>
bool CancelInstallation(Guid id);
6 years ago
}
}