aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common
diff options
context:
space:
mode:
authorLukePulverenti <luke.pulverenti@gmail.com>2013-02-26 16:06:01 -0500
committerLukePulverenti <luke.pulverenti@gmail.com>2013-02-26 16:06:01 -0500
commitf008a11684fedd3b3100c87313225775d5ac4505 (patch)
treec8acd6e7ad9e5dfeef0a984879a650ecc8b86c10 /MediaBrowser.Common
parent51b3c32e2cc84778212531d72665d2c5f567f34a (diff)
parent0c8d924bfc64f91b7883507ebdfdc664a8495465 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Common')
-rw-r--r--MediaBrowser.Common/MediaBrowser.Common.csproj1
-rw-r--r--MediaBrowser.Common/Updates/IInstallationManager.cs119
2 files changed, 120 insertions, 0 deletions
diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj
index b136eb43c..a10f36da0 100644
--- a/MediaBrowser.Common/MediaBrowser.Common.csproj
+++ b/MediaBrowser.Common/MediaBrowser.Common.csproj
@@ -135,6 +135,7 @@
<Compile Include="ScheduledTasks\DailyTrigger.cs" />
<Compile Include="ScheduledTasks\IntervalTrigger.cs" />
<Compile Include="ScheduledTasks\WeeklyTrigger.cs" />
+ <Compile Include="Updates\IInstallationManager.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
diff --git a/MediaBrowser.Common/Updates/IInstallationManager.cs b/MediaBrowser.Common/Updates/IInstallationManager.cs
new file mode 100644
index 000000000..23c147748
--- /dev/null
+++ b/MediaBrowser.Common/Updates/IInstallationManager.cs
@@ -0,0 +1,119 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using MediaBrowser.Common.Events;
+using MediaBrowser.Common.Plugins;
+using MediaBrowser.Model.Updates;
+
+namespace MediaBrowser.Common.Updates
+{
+ public interface IInstallationManager
+ {
+ /// <summary>
+ /// The current installations
+ /// </summary>
+ List<Tuple<InstallationInfo, CancellationTokenSource>> CurrentInstallations { get; set; }
+
+ /// <summary>
+ /// The completed installations
+ /// </summary>
+ ConcurrentBag<InstallationInfo> CompletedInstallations { get; set; }
+
+ /// <summary>
+ /// Occurs when [plugin uninstalled].
+ /// </summary>
+ event EventHandler<GenericEventArgs<IPlugin>> PluginUninstalled;
+
+ /// <summary>
+ /// Occurs when [plugin updated].
+ /// </summary>
+ event EventHandler<GenericEventArgs<Tuple<IPlugin, PackageVersionInfo>>> PluginUpdated;
+
+ /// <summary>
+ /// Called when [plugin updated].
+ /// </summary>
+ /// <param name="plugin">The plugin.</param>
+ /// <param name="newVersion">The new version.</param>
+ void OnPluginUpdated(IPlugin plugin, PackageVersionInfo newVersion);
+
+ /// <summary>
+ /// Occurs when [plugin updated].
+ /// </summary>
+ event EventHandler<GenericEventArgs<PackageVersionInfo>> PluginInstalled;
+
+ /// <summary>
+ /// Called when [plugin installed].
+ /// </summary>
+ /// <param name="package">The package.</param>
+ void OnPluginInstalled(PackageVersionInfo package);
+
+ /// <summary>
+ /// Gets all available packages.
+ /// </summary>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <param name="packageType">Type of the package.</param>
+ /// <param name="applicationVersion">The application version.</param>
+ /// <returns>Task{List{PackageInfo}}.</returns>
+ Task<IEnumerable<PackageInfo>> GetAvailablePackages(CancellationToken cancellationToken,
+ PackageType? packageType = null,
+ Version applicationVersion = null);
+
+ /// <summary>
+ /// Gets the package.
+ /// </summary>
+ /// <param name="name">The name.</param>
+ /// <param name="classification">The classification.</param>
+ /// <param name="version">The version.</param>
+ /// <returns>Task{PackageVersionInfo}.</returns>
+ Task<PackageVersionInfo> GetPackage(string name, PackageVersionClass classification, Version version);
+
+ /// <summary>
+ /// Gets the latest compatible version.
+ /// </summary>
+ /// <param name="name">The name.</param>
+ /// <param name="classification">The classification.</param>
+ /// <returns>Task{PackageVersionInfo}.</returns>
+ Task<PackageVersionInfo> GetLatestCompatibleVersion(string name, PackageVersionClass classification = PackageVersionClass.Release);
+
+ /// <summary>
+ /// Gets the latest compatible version.
+ /// </summary>
+ /// <param name="availablePackages">The available packages.</param>
+ /// <param name="name">The name.</param>
+ /// <param name="classification">The classification.</param>
+ /// <returns>PackageVersionInfo.</returns>
+ PackageVersionInfo GetLatestCompatibleVersion(IEnumerable<PackageInfo> availablePackages, string name, PackageVersionClass classification = PackageVersionClass.Release);
+
+ /// <summary>
+ /// Gets the available plugin updates.
+ /// </summary>
+ /// <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(bool withAutoUpdateEnabled, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Installs the package.
+ /// </summary>
+ /// <param name="package">The package.</param>
+ /// <param name="progress">The progress.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task.</returns>
+ /// <exception cref="System.ArgumentNullException">package</exception>
+ Task InstallPackage(PackageVersionInfo package, IProgress<double> progress, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Uninstalls a plugin
+ /// </summary>
+ /// <param name="plugin">The plugin.</param>
+ /// <exception cref="System.ArgumentException"></exception>
+ void UninstallPlugin(IPlugin plugin);
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ void Dispose();
+ }
+} \ No newline at end of file