Fixed failing tests.

This commit is contained in:
Taloth Saldono 2018-11-23 19:59:01 +01:00
parent 080bf6787a
commit bfe2976463
3 changed files with 5 additions and 5 deletions

View File

@ -21,7 +21,7 @@ namespace NzbDrone.Core.Configuration
Version ReleaseVersion { get; }
string ReleaseBranch { get; }
bool BuiltInUpdaterAllowed { get; }
bool IsExternalUpdateMechanism { get; }
UpdateMechanism DefaultUpdateMechanism { get; }
string DefaultBranch { get; }
}
@ -111,7 +111,7 @@ namespace NzbDrone.Core.Configuration
public string ReleaseBranch { get; set; }
public bool BuiltInUpdaterAllowed => PackageUpdateMechanism == UpdateMechanism.BuiltIn;
public bool IsExternalUpdateMechanism => PackageUpdateMechanism >= UpdateMechanism.External;
public UpdateMechanism DefaultUpdateMechanism { get; private set; }
public string DefaultBranch { get; private set; }
}

View File

@ -35,7 +35,7 @@ namespace NzbDrone.Core.Update
var externalMechanisms = Enum.GetValues(typeof(UpdateMechanism))
.Cast<UpdateMechanism>()
.Where(v => (int)v >= (int)UpdateMechanism.External)
.Where(v => v >= UpdateMechanism.External)
.ToArray();
foreach (var externalMechanism in externalMechanisms)

View File

@ -220,12 +220,12 @@ namespace NzbDrone.Core.Update
// Safety net, ConfigureUpdateMechanism should take care of invalid settings
if (_configFileProvider.UpdateMechanism == UpdateMechanism.BuiltIn && !_deploymentInfoProvider.BuiltInUpdaterAllowed)
if (_configFileProvider.UpdateMechanism == UpdateMechanism.BuiltIn && _deploymentInfoProvider.IsExternalUpdateMechanism)
{
_logger.ProgressDebug("Built-In updater disabled, please use {0} to install", _deploymentInfoProvider.PackageUpdateMechanism);
return;
}
else if (_configFileProvider.UpdateMechanism != UpdateMechanism.Script && !_deploymentInfoProvider.BuiltInUpdaterAllowed)
else if (_configFileProvider.UpdateMechanism != UpdateMechanism.Script && _deploymentInfoProvider.IsExternalUpdateMechanism)
{
_logger.ProgressDebug("Update available, please use {0} to install", _deploymentInfoProvider.PackageUpdateMechanism);
return;