mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-30 17:49:57 -06:00
move version checking into a single method to unify updater logic across the app
This commit is contained in:
@ -56,15 +56,8 @@ namespace Ryujinx.Ava.Systems
|
||||
private static string _stableUrlFormat = null;
|
||||
private static string _changelogUrlFormat = null;
|
||||
|
||||
public static async Task BeginUpdateAsync(bool showVersionUpToDate = false)
|
||||
public static async Task<Optional<(Version, Version)>> CheckForUpdateAsync(bool showVersionUpToDate = false)
|
||||
{
|
||||
if (_running)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_running = true;
|
||||
|
||||
Optional<(Version, Version)> versionTuple;
|
||||
|
||||
try
|
||||
@ -78,6 +71,21 @@ namespace Ryujinx.Ava.Systems
|
||||
versionTuple = await CheckGitHubVersionAsync(showVersionUpToDate);
|
||||
}
|
||||
|
||||
return versionTuple;
|
||||
}
|
||||
|
||||
|
||||
public static async Task BeginUpdateAsync(bool showVersionUpToDate = false)
|
||||
{
|
||||
if (_running)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_running = true;
|
||||
|
||||
Optional<(Version, Version)> versionTuple = await CheckForUpdateAsync(showVersionUpToDate);
|
||||
|
||||
if (_running is false || !versionTuple.HasValue)
|
||||
return;
|
||||
|
||||
|
Reference in New Issue
Block a user