mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
real fix
This commit is contained in:
parent
b69a5a2e14
commit
764ef17725
2 changed files with 11 additions and 7 deletions
|
@ -44,16 +44,11 @@ namespace Ombi.Schedule.Jobs.Ombi
|
||||||
}
|
}
|
||||||
public async Task<bool> UpdateAvailable(string branch, string currentVersion)
|
public async Task<bool> UpdateAvailable(string branch, string currentVersion)
|
||||||
{
|
{
|
||||||
try
|
|
||||||
{
|
|
||||||
var updates = await OmbiService.GetUpdates(branch);
|
var updates = await OmbiService.GetUpdates(branch);
|
||||||
var serverVersion = updates.UpdateVersionString;
|
var serverVersion = updates.UpdateVersionString;
|
||||||
return !serverVersion.Equals(currentVersion, StringComparison.CurrentCultureIgnoreCase);
|
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)
|
public async Task Update(PerformContext c)
|
||||||
|
|
|
@ -41,12 +41,21 @@ namespace Ombi.Controllers
|
||||||
[HttpGet("update")]
|
[HttpGet("update")]
|
||||||
public async Task<bool> CheckForUpdate()
|
public async Task<bool> CheckForUpdate()
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
var productArray = _updater.GetVersion();
|
var productArray = _updater.GetVersion();
|
||||||
var version = productArray[0];
|
var version = productArray[0];
|
||||||
var branch = productArray[1];
|
var branch = productArray[1];
|
||||||
var updateAvailable = await _updater.UpdateAvailable(branch, version);
|
var updateAvailable = await _updater.UpdateAvailable(branch, version);
|
||||||
|
|
||||||
return updateAvailable;
|
return updateAvailable;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("updateCached")]
|
[HttpGet("updateCached")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue