From f4f91a8316f46ea91dca6447bcff495b7c0f0b40 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 30 Sep 2013 11:04:38 -0400 Subject: [PATCH] auto update fixes --- .../ScheduledTasks/Tasks/SystemUpdateTask.cs | 1 + .../Updates/InstallationManager.cs | 6 +++--- MediaBrowser.Common/Updates/IInstallationManager.cs | 4 ++-- MediaBrowser.ServerApplication/ApplicationHost.cs | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/SystemUpdateTask.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/SystemUpdateTask.cs index 33917125e..88d56fead 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.Tasks public async Task Execute(CancellationToken cancellationToken, IProgress progress) { if (!_appHost.CanSelfUpdate) return; + if (!ConfigurationManager.CommonConfiguration.EnableAutoUpdate) return; EventHandler innerProgressHandler = (sender, e) => progress.Report(e * .1); diff --git a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs index cc4324e98..56190e9bd 100644 --- a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs +++ b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs @@ -311,11 +311,11 @@ namespace MediaBrowser.Common.Implementations.Updates /// /// Gets the available plugin updates. /// - /// The current server version. + /// The current server version. /// if set to true [with auto update enabled]. /// The cancellation token. /// Task{IEnumerable{PackageVersionInfo}}. - public async Task> GetAvailablePluginUpdates(Version currentServerVersion, bool withAutoUpdateEnabled, CancellationToken cancellationToken) + public async Task> 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 installed var 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.cs index 6ef90ac5f..b64506c97 100644 --- a/MediaBrowser.Common/Updates/IInstallationManager.cs +++ b/MediaBrowser.Common/Updates/IInstallationManager.cs @@ -90,11 +90,11 @@ namespace MediaBrowser.Common.Updates /// /// Gets the available plugin updates. /// - /// The current server version. + /// The current server version. /// if set to true [with auto update enabled]. /// The cancellation token. /// Task{IEnumerable{PackageVersionInfo}}. - Task> GetAvailablePluginUpdates(Version currentServerVersion, bool withAutoUpdateEnabled, CancellationToken cancellationToken); + Task> GetAvailablePluginUpdates(Version applicationVersion, bool withAutoUpdateEnabled, CancellationToken cancellationToken); /// /// Installs the package. diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 0128e6f8b..c60ec7f6d 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -511,7 +511,7 @@ namespace MediaBrowser.ServerApplication #if DEBUG return false; #endif - return ConfigurationManager.CommonConfiguration.EnableAutoUpdate; + return true; } }