The Free Software Media System - Server Backend & API
auto update fixes
Luke Pulverentif4f91a8316f4
diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/SystemUpdateTask.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/SystemUpdateTask.csindex 33917125e2..88d56fead2 100644--- a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/SystemUpdateTask.cs+++ b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/SystemUpdateTask.cs@@ -68,6 +68,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Taskspublic async Task Execute(CancellationToken cancellationToken, IProgress<double> progress){if (!_appHost.CanSelfUpdate) return;+ if (!ConfigurationManager.CommonConfiguration.EnableAutoUpdate) return;EventHandler<double> innerProgressHandler = (sender, e) => progress.Report(e * .1);diff --git a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs b/MediaBrowser.Common.Implementations/Updates/InstallationManager.csindex cc4324e989..56190e9bd8 100644--- a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs+++ b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs@@ -311,11 +311,11 @@ namespace MediaBrowser.Common.Implementations.Updates/// <summary>/// Gets the available plugin updates./// </summary>- /// <param name="currentServerVersion">The current server version.</param>+ /// <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>- public async Task<IEnumerable<PackageVersionInfo>> GetAvailablePluginUpdates(Version currentServerVersion, bool withAutoUpdateEnabled, CancellationToken cancellationToken)+ public async Task<IEnumerable<PackageVersionInfo>> GetAvailablePluginUpdates(Version applicationVersion, bool withAutoUpdateEnabled, CancellationToken cancellationToken){var catalog = await GetAvailablePackagesWithoutRegistrationInfo(cancellationToken).ConfigureAwait(false);@@ -331,7 +331,7 @@ namespace MediaBrowser.Common.Implementations.Updates// Figure out what needs to be installedvar packages = plugins.Select(p =>{- var latestPluginInfo = GetLatestCompatibleVersion(catalog, p.Name, currentServerVersion, p.Configuration.UpdateClass);+ var latestPluginInfo = GetLatestCompatibleVersion(catalog, p.Name, applicationVersion, p.Configuration.UpdateClass);return latestPluginInfo != null && latestPluginInfo.version != null && latestPluginInfo.version > p.Version ? latestPluginInfo : null;diff --git a/MediaBrowser.Common/Updates/IInstallationManager.cs b/MediaBrowser.Common/Updates/IInstallationManager.csindex 6ef90ac5f4..b64506c973 100644--- a/MediaBrowser.Common/Updates/IInstallationManager.cs+++ b/MediaBrowser.Common/Updates/IInstallationManager.cs@@ -90,11 +90,11 @@ namespace MediaBrowser.Common.Updates/// <summary>/// Gets the available plugin updates./// </summary>- /// <param name="currentServerVersion">The current server version.</param>+ /// <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 currentServerVersion, bool withAutoUpdateEnabled, CancellationToken cancellationToken);+ Task<IEnumerable<PackageVersionInfo>> GetAvailablePluginUpdates(Version applicationVersion, bool withAutoUpdateEnabled, CancellationToken cancellationToken);/// <summary>/// Installs the package.diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.csindex 0128e6f8ba..c60ec7f6dd 100644--- a/MediaBrowser.ServerApplication/ApplicationHost.cs+++ b/MediaBrowser.ServerApplication/ApplicationHost.cs@@ -511,7 +511,7 @@ namespace MediaBrowser.ServerApplication#if DEBUGreturn false;#endif- return ConfigurationManager.CommonConfiguration.EnableAutoUpdate;+ return true;}}