diff options
| author | Bond_009 <bond.009@outlook.com> | 2019-10-08 20:51:11 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2019-11-01 17:57:19 +0100 |
| commit | d529f81cd93029e6293b8457bc7090d4277c0228 (patch) | |
| tree | b7051556d1f909806210473a7eda10ea467c2cf2 /MediaBrowser.Common/Updates/IInstallationManager.cs | |
| parent | 89a21c96c05dd89ff2d2bd5926d0f98c6ef0db9b (diff) | |
Improve IInstallationManager interface
Diffstat (limited to 'MediaBrowser.Common/Updates/IInstallationManager.cs')
| -rw-r--r-- | MediaBrowser.Common/Updates/IInstallationManager.cs | 76 |
1 files changed, 36 insertions, 40 deletions
diff --git a/MediaBrowser.Common/Updates/IInstallationManager.cs b/MediaBrowser.Common/Updates/IInstallationManager.cs index b3367f71d..ce4829c13 100644 --- a/MediaBrowser.Common/Updates/IInstallationManager.cs +++ b/MediaBrowser.Common/Updates/IInstallationManager.cs @@ -18,11 +18,6 @@ namespace MediaBrowser.Common.Updates event EventHandler<InstallationEventArgs> PackageInstallationCancelled; /// <summary> - /// The completed installations - /// </summary> - IEnumerable<InstallationInfo> CompletedInstallations { get; } - - /// <summary> /// Occurs when [plugin uninstalled]. /// </summary> event EventHandler<GenericEventArgs<IPlugin>> PluginUninstalled; @@ -38,62 +33,63 @@ namespace MediaBrowser.Common.Updates event EventHandler<GenericEventArgs<PackageVersionInfo>> PluginInstalled; /// <summary> - /// Gets all available packages. + /// The completed installations /// </summary> - /// <param name="cancellationToken">The cancellation token.</param> - /// <param name="withRegistration">if set to <c>true</c> [with registration].</param> - /// <param name="packageType">Type of the package.</param> - /// <param name="applicationVersion">The application version.</param> - /// <returns>Task{List{PackageInfo}}.</returns> - Task<List<PackageInfo>> GetAvailablePackages(CancellationToken cancellationToken, - bool withRegistration = true, string packageType = null, Version applicationVersion = null); + IEnumerable<InstallationInfo> CompletedInstallations { get; } /// <summary> - /// Gets all available packages from a static resource. + /// Gets all available packages. /// </summary> /// <param name="cancellationToken">The cancellation token.</param> - /// <returns>Task{List{PackageInfo}}.</returns> - Task<List<PackageInfo>> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken); + /// <returns>Task{IReadOnlyList{PackageInfo}}.</returns> + Task<IReadOnlyList<PackageInfo>> GetAvailablePackages(CancellationToken cancellationToken = default); /// <summary> - /// Gets the package. + /// Returns all plugins matching the requirements. /// </summary> - /// <param name="name">The name.</param> - /// <param name="guid">The assembly guid</param> - /// <param name="classification">The classification.</param> - /// <param name="version">The version.</param> - /// <returns>Task{PackageVersionInfo}.</returns> - Task<PackageVersionInfo> GetPackage(string name, string guid, PackageVersionClass classification, Version version); + /// <param name="availablePackages">The available packages.</param> + /// <param name="name">The name of the plugin.</param> + /// <param name="guid">The id of the plugin.</param> + /// <returns>All plugins matching the requirements.</returns> + IEnumerable<PackageInfo> FilterPackages( + IEnumerable<PackageInfo> availablePackages, + string name = null, + Guid guid = default); /// <summary> - /// Gets the latest compatible version. + /// Returns all compatible versions ordered from newest to oldest. /// </summary> - /// <param name="name">The name.</param> - /// <param name="guid">The assembly guid</param> - /// <param name="currentServerVersion">The current server version.</param> - /// <param name="classification">The classification.</param> - /// <returns>Task{PackageVersionInfo}.</returns> - Task<PackageVersionInfo> GetLatestCompatibleVersion(string name, string guid, Version currentServerVersion, PackageVersionClass classification = PackageVersionClass.Release); + /// <param name="availableVersions">The available version of the plugin.</param> + /// <param name="minVersion">The minimum required version of the plugin.</param> + /// <param name="classification">The classification of updates.</param> + /// <returns>All compatible versions ordered from newest to oldest.</returns> + IEnumerable<PackageVersionInfo> GetCompatibleVersions( + IEnumerable<PackageVersionInfo> availableVersions, + Version minVersion = null, + PackageVersionClass classification = PackageVersionClass.Release); /// <summary> - /// Gets the latest compatible version. + /// Returns all compatible versions ordered from newest to oldest. /// </summary> /// <param name="availablePackages">The available packages.</param> /// <param name="name">The name.</param> - /// <param name="guid">The assembly guid</param> - /// <param name="currentServerVersion">The current server version.</param> + /// <param name="guid">The guid of the plugin.</param> + /// <param name="minVersion">The minimum required version of the plugin.</param> /// <param name="classification">The classification.</param> - /// <returns>PackageVersionInfo.</returns> - PackageVersionInfo GetLatestCompatibleVersion(IEnumerable<PackageInfo> availablePackages, string name, string guid, Version currentServerVersion, PackageVersionClass classification = PackageVersionClass.Release); + /// <returns>All compatible versions ordered from newest to oldest.</returns> + IEnumerable<PackageVersionInfo> GetCompatibleVersions( + IEnumerable<PackageInfo> availablePackages, + string name = null, + Guid guid = default, + Version minVersion = null, + PackageVersionClass classification = PackageVersionClass.Release); /// <summary> - /// Gets the available plugin updates. + /// Returns the available plugin updates. /// </summary> - /// <param name="applicationVersion">The current server version.</param> - /// <param name="withAutoUpdateEnabled">if set to <c>true</c> [with auto update enabled].</param> /// <param name="cancellationToken">The cancellation token.</param> - /// <returns>Task{IEnumerable{PackageVersionInfo}}.</returns> - Task<IEnumerable<PackageVersionInfo>> GetAvailablePluginUpdates(Version applicationVersion, bool withAutoUpdateEnabled, CancellationToken cancellationToken); + /// <returns>Tthe available plugin updates.</returns> + Task<IEnumerable<PackageVersionInfo>> GetAvailablePluginUpdates(CancellationToken cancellationToken = default); /// <summary> /// Installs the package. |
