Fixed failing tests.

pull/2789/head
Taloth Saldono 6 years ago
parent 080bf6787a
commit bfe2976463

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

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

@ -220,12 +220,12 @@ namespace NzbDrone.Core.Update
// Safety net, ConfigureUpdateMechanism should take care of invalid settings // 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); _logger.ProgressDebug("Built-In updater disabled, please use {0} to install", _deploymentInfoProvider.PackageUpdateMechanism);
return; 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); _logger.ProgressDebug("Update available, please use {0} to install", _deploymentInfoProvider.PackageUpdateMechanism);
return; return;

Loading…
Cancel
Save