diff options
Diffstat (limited to 'MediaBrowser.Common')
| -rw-r--r-- | MediaBrowser.Common/IApplicationHost.cs | 8 | ||||
| -rw-r--r-- | MediaBrowser.Common/Updates/IInstallationManager.cs | 85 |
2 files changed, 49 insertions, 44 deletions
diff --git a/MediaBrowser.Common/IApplicationHost.cs b/MediaBrowser.Common/IApplicationHost.cs index c8da100f6..6668e98aa 100644 --- a/MediaBrowser.Common/IApplicationHost.cs +++ b/MediaBrowser.Common/IApplicationHost.cs @@ -67,7 +67,13 @@ namespace MediaBrowser.Common /// Gets the application version. /// </summary> /// <value>The application version.</value> - string ApplicationVersion { get; } + Version ApplicationVersion { get; } + + /// <summary> + /// Gets the application version. + /// </summary> + /// <value>The application version.</value> + string ApplicationVersionString { get; } /// <summary> /// Gets the application user agent. diff --git a/MediaBrowser.Common/Updates/IInstallationManager.cs b/MediaBrowser.Common/Updates/IInstallationManager.cs index b3367f71d..524d8f3c6 100644 --- a/MediaBrowser.Common/Updates/IInstallationManager.cs +++ b/MediaBrowser.Common/Updates/IInstallationManager.cs @@ -13,87 +13,86 @@ namespace MediaBrowser.Common.Updates public interface IInstallationManager : IDisposable { event EventHandler<InstallationEventArgs> PackageInstalling; + event EventHandler<InstallationEventArgs> PackageInstallationCompleted; + event EventHandler<InstallationFailedEventArgs> PackageInstallationFailed; - event EventHandler<InstallationEventArgs> PackageInstallationCancelled; - /// <summary> - /// The completed installations - /// </summary> - IEnumerable<InstallationInfo> CompletedInstallations { get; } + event EventHandler<InstallationEventArgs> PackageInstallationCancelled; /// <summary> - /// Occurs when [plugin uninstalled]. + /// Occurs when a plugin is uninstalled. /// </summary> event EventHandler<GenericEventArgs<IPlugin>> PluginUninstalled; /// <summary> - /// Occurs when [plugin updated]. + /// Occurs when a plugin is updated. /// </summary> event EventHandler<GenericEventArgs<(IPlugin, PackageVersionInfo)>> PluginUpdated; /// <summary> - /// Occurs when [plugin updated]. + /// Occurs when a plugin is installed. /// </summary> event EventHandler<GenericEventArgs<PackageVersionInfo>> PluginInstalled; /// <summary> - /// Gets all available packages. + /// Gets 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>The available plugin updates.</returns> + Task<IEnumerable<PackageVersionInfo>> GetAvailablePluginUpdates(CancellationToken cancellationToken = default); /// <summary> /// Installs the package. |
