Create constants for package names

This commit is contained in:
Eric Reed 2013-03-02 13:54:31 -05:00
parent 72051998e7
commit 5d397aa363
2 changed files with 4 additions and 1 deletions

View File

@ -9,5 +9,7 @@ namespace MediaBrowser.Common.Constants
public static class Constants
{
public const string MBAdminUrl = "http://www.mb3admin.com/admin/";
public const string MBServerPkgName = "MBServer";
public const string MBTheaterPkgName = "MBTheater";
}
}

View File

@ -1,4 +1,5 @@
using MediaBrowser.Api;
using MediaBrowser.Common.Constants;
using MediaBrowser.Common.Implementations;
using MediaBrowser.Common.Implementations.HttpServer;
using MediaBrowser.Common.Implementations.Logging;
@ -180,7 +181,7 @@ namespace MediaBrowser.ServerApplication
{
var pkgManager = Resolve<IPackageManager>();
var availablePackages = await pkgManager.GetAvailablePackages(Resolve<IHttpClient>(), Resolve<INetworkManager>(), Kernel.SecurityManager, Kernel.ResourcePools, Resolve<IJsonSerializer>(), CancellationToken.None).ConfigureAwait(false);
var version = Kernel.InstallationManager.GetLatestCompatibleVersion(availablePackages, "MBServer", Kernel.Configuration.SystemUpdateLevel);
var version = Kernel.InstallationManager.GetLatestCompatibleVersion(availablePackages, Constants.MBServerPkgName, Kernel.Configuration.SystemUpdateLevel);
return version != null ? new CheckForUpdateResult { AvailableVersion = version.version, IsUpdateAvailable = version.version > ApplicationVersion, Package = version } :
new CheckForUpdateResult { AvailableVersion = ApplicationVersion, IsUpdateAvailable = false };