auto update fixes

This commit is contained in:
Luke Pulverenti 2013-09-30 11:04:38 -04:00
parent 3733ebd21e
commit f4f91a8316
4 changed files with 7 additions and 6 deletions

View File

@ -68,6 +68,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress) public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
{ {
if (!_appHost.CanSelfUpdate) return; if (!_appHost.CanSelfUpdate) return;
if (!ConfigurationManager.CommonConfiguration.EnableAutoUpdate) return;
EventHandler<double> innerProgressHandler = (sender, e) => progress.Report(e * .1); EventHandler<double> innerProgressHandler = (sender, e) => progress.Report(e * .1);

View File

@ -311,11 +311,11 @@ namespace MediaBrowser.Common.Implementations.Updates
/// <summary> /// <summary>
/// Gets the available plugin updates. /// Gets the available plugin updates.
/// </summary> /// </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="withAutoUpdateEnabled">if set to <c>true</c> [with auto update enabled].</param>
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{IEnumerable{PackageVersionInfo}}.</returns> /// <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); var catalog = await GetAvailablePackagesWithoutRegistrationInfo(cancellationToken).ConfigureAwait(false);
@ -331,7 +331,7 @@ namespace MediaBrowser.Common.Implementations.Updates
// Figure out what needs to be installed // Figure out what needs to be installed
var packages = plugins.Select(p => 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; return latestPluginInfo != null && latestPluginInfo.version != null && latestPluginInfo.version > p.Version ? latestPluginInfo : null;

View File

@ -90,11 +90,11 @@ namespace MediaBrowser.Common.Updates
/// <summary> /// <summary>
/// Gets the available plugin updates. /// Gets the available plugin updates.
/// </summary> /// </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="withAutoUpdateEnabled">if set to <c>true</c> [with auto update enabled].</param>
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{IEnumerable{PackageVersionInfo}}.</returns> /// <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> /// <summary>
/// Installs the package. /// Installs the package.

View File

@ -511,7 +511,7 @@ namespace MediaBrowser.ServerApplication
#if DEBUG #if DEBUG
return false; return false;
#endif #endif
return ConfigurationManager.CommonConfiguration.EnableAutoUpdate; return true;
} }
} }