mirror of
https://github.com/Radarr/Radarr
synced 2025-02-28 00:45:50 +00:00
Checks for update regardless of settings, but won't install it.
This commit is contained in:
parent
0934900cab
commit
104d35299b
1 changed files with 4 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common.EnvironmentInfo;
|
using NzbDrone.Common.EnvironmentInfo;
|
||||||
using NzbDrone.Common.Instrumentation.Extensions;
|
using NzbDrone.Common.Instrumentation.Extensions;
|
||||||
|
@ -30,13 +31,13 @@ public CheckUpdateService(IUpdatePackageProvider updatePackageProvider,
|
||||||
|
|
||||||
public UpdatePackage AvailableUpdate()
|
public UpdatePackage AvailableUpdate()
|
||||||
{
|
{
|
||||||
|
var latestAvailable = _updatePackageProvider.GetLatestUpdate(_configFileProvider.Branch, BuildInfo.Version);
|
||||||
|
|
||||||
if (OsInfo.IsNotWindows && !_configFileProvider.UpdateAutomatically)
|
if (OsInfo.IsNotWindows && !_configFileProvider.UpdateAutomatically)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var latestAvailable = _updatePackageProvider.GetLatestUpdate(_configFileProvider.Branch, BuildInfo.Version);
|
|
||||||
|
|
||||||
if (latestAvailable == null)
|
if (latestAvailable == null)
|
||||||
{
|
{
|
||||||
_logger.ProgressDebug("No update available.");
|
_logger.ProgressDebug("No update available.");
|
||||||
|
@ -46,7 +47,7 @@ public UpdatePackage AvailableUpdate()
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_logger.Info("Branch [{0}] is being redirected to [{1}]]", _configFileProvider.Branch, latestAvailable.Branch);
|
_logger.Info("Branch [{0}] is being redirected to [{1}]]", _configFileProvider.Branch, latestAvailable.Branch);
|
||||||
var config = _configFileProvider.GetConfigDictionary();
|
var config = new Dictionary<string, object>();
|
||||||
config["Branch"] = latestAvailable.Branch;
|
config["Branch"] = latestAvailable.Branch;
|
||||||
_configFileProvider.SaveConfigDictionary(config);
|
_configFileProvider.SaveConfigDictionary(config);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue