pull/1529/head
tidusjar 7 years ago
parent b69a5a2e14
commit 764ef17725

@ -44,16 +44,11 @@ namespace Ombi.Schedule.Jobs.Ombi
}
public async Task<bool> UpdateAvailable(string branch, string currentVersion)
{
try
{
var updates = await OmbiService.GetUpdates(branch);
var serverVersion = updates.UpdateVersionString;
return !serverVersion.Equals(currentVersion, StringComparison.CurrentCultureIgnoreCase);
}
catch (Exception e)
{
Logger.LogError(e, "Attempted to check if there was an update");
}
}
public async Task Update(PerformContext c)

@ -41,12 +41,21 @@ namespace Ombi.Controllers
[HttpGet("update")]
public async Task<bool> CheckForUpdate()
{
try
{
var productArray = _updater.GetVersion();
var version = productArray[0];
var branch = productArray[1];
var updateAvailable = await _updater.UpdateAvailable(branch, version);
return updateAvailable;
}
catch (Exception e)
{
return false;
}
}
[HttpGet("updateCached")]

Loading…
Cancel
Save