fix merge conflict

This commit is contained in:
Luke Pulverenti 2016-08-27 15:52:58 -04:00
parent 9d762c3878
commit a8fb422fe4

View File

@ -62,31 +62,27 @@ namespace MediaBrowser.Server.Startup.Common.Migrations
var newUpdateLevel = updateLevel; var newUpdateLevel = updateLevel;
if (releases.Count >= 2) // If the current version is later than current stable, set the update level to beta
if (releases.Count >= 1)
{ {
var beta = releases[1]; var release = releases[0];
Version version; var version = ParseVersion(release.tag_name);
if (Version.TryParse(beta.tag_name, out version)) if (version != null && currentVersion > version)
{
if (currentVersion >= version)
{ {
newUpdateLevel = PackageVersionClass.Beta; newUpdateLevel = PackageVersionClass.Beta;
} }
} }
}
if (releases.Count >= 3) // If the current version is later than current beta, set the update level to dev
if (releases.Count >= 2)
{ {
var dev = releases[2]; var release = releases[1];
Version version; var version = ParseVersion(release.tag_name);
if (Version.TryParse(dev.tag_name, out version)) if (version != null && currentVersion > version)
{
if (currentVersion >= version)
{ {
newUpdateLevel = PackageVersionClass.Dev; newUpdateLevel = PackageVersionClass.Dev;
} }
} }
}
if (newUpdateLevel != updateLevel) if (newUpdateLevel != updateLevel)
{ {
@ -94,5 +90,19 @@ namespace MediaBrowser.Server.Startup.Common.Migrations
_config.SaveConfiguration(); _config.SaveConfiguration();
} }
} }
private Version ParseVersion(string versionString)
{
var parts = versionString.Split('.');
if (parts.Length == 3)
{
versionString += ".0";
}
Version version;
Version.TryParse(versionString, out version);
return version;
}
} }
} }