mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-07 17:07:15 +00:00
use changelog url format variable in more places + remove stable url format variable
This commit is contained in:
parent
91248bdd32
commit
c9116e2a52
@ -32,10 +32,10 @@ namespace Ryujinx.Common
|
|||||||
|
|
||||||
public static string Version => IsValid ? BuildVersion : Assembly.GetEntryAssembly()!.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
|
public static string Version => IsValid ? BuildVersion : Assembly.GetEntryAssembly()!.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
|
||||||
|
|
||||||
public static string GetChangelogUrl(Version currentVersion, Version newVersion, string stableUrl) =>
|
public static string GetChangelogUrl(Version currentVersion, Version newVersion) =>
|
||||||
IsCanaryBuild
|
IsCanaryBuild
|
||||||
? $"https://git.ryujinx.app/ryubing/ryujinx/-/compare/Canary-{currentVersion}...Canary-{newVersion}"
|
? $"https://git.ryujinx.app/ryubing/ryujinx/-/compare/Canary-{currentVersion}...Canary-{newVersion}"
|
||||||
: stableUrl;
|
: $"https://git.ryujinx.app/ryubing/ryujinx/-/releases/{newVersion}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +49,6 @@ namespace Ryujinx.Ava.Systems
|
|||||||
: releaseChannels.Stable;
|
: releaseChannels.Stable;
|
||||||
|
|
||||||
_changelogUrlFormat = _currentGitHubReleaseChannel.Value.UrlFormat;
|
_changelogUrlFormat = _currentGitHubReleaseChannel.Value.UrlFormat;
|
||||||
_stableUrlFormat = releaseChannels.Stable.UrlFormat;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string fetchedJson = await jsonClient.GetStringAsync(_currentGitHubReleaseChannel.Value.GetLatestReleaseApiUrl());
|
string fetchedJson = await jsonClient.GetStringAsync(_currentGitHubReleaseChannel.Value.GetLatestReleaseApiUrl());
|
||||||
@ -72,7 +71,7 @@ namespace Ryujinx.Ava.Systems
|
|||||||
|
|
||||||
if (userResult is UserResult.Ok)
|
if (userResult is UserResult.Ok)
|
||||||
{
|
{
|
||||||
OpenHelper.OpenUrl(_currentGitHubReleaseChannel.Value.UrlFormat.Format(currentVersion));
|
OpenHelper.OpenUrl(_changelogUrlFormat.Format(currentVersion));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +97,7 @@ namespace Ryujinx.Ava.Systems
|
|||||||
|
|
||||||
if (userResult is UserResult.Ok)
|
if (userResult is UserResult.Ok)
|
||||||
{
|
{
|
||||||
OpenHelper.OpenUrl(_currentGitHubReleaseChannel.Value.UrlFormat.Format(currentVersion));
|
OpenHelper.OpenUrl(_changelogUrlFormat.Format(currentVersion));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,8 +19,7 @@ namespace Ryujinx.Ava.Systems
|
|||||||
{
|
{
|
||||||
private static GitLabReleaseChannels.ChannelType _currentGitLabReleaseChannel;
|
private static GitLabReleaseChannels.ChannelType _currentGitLabReleaseChannel;
|
||||||
|
|
||||||
private static async Task<Optional<(Version Current, Version Incoming)>> CheckGitLabVersionAsync(
|
private static async Task<Optional<(Version Current, Version Incoming)>> CheckGitLabVersionAsync(bool showVersionUpToDate = false)
|
||||||
bool showVersionUpToDate = false)
|
|
||||||
{
|
{
|
||||||
if (!Version.TryParse(Program.Version, out Version currentVersion))
|
if (!Version.TryParse(Program.Version, out Version currentVersion))
|
||||||
{
|
{
|
||||||
@ -39,12 +38,10 @@ namespace Ryujinx.Ava.Systems
|
|||||||
Logger.Info?.Print(LogClass.Application, "Checking for updates from https://git.ryujinx.app.");
|
Logger.Info?.Print(LogClass.Application, "Checking for updates from https://git.ryujinx.app.");
|
||||||
|
|
||||||
// Get latest version number from GitLab API
|
// Get latest version number from GitLab API
|
||||||
|
|
||||||
using HttpClient jsonClient = ConstructHttpClient();
|
using HttpClient jsonClient = ConstructHttpClient();
|
||||||
|
|
||||||
jsonClient.Timeout =
|
// GitLab instance is located in Ukraine. Connection times will vary across the world.
|
||||||
TimeSpan.FromSeconds(
|
jsonClient.Timeout = TimeSpan.FromSeconds(10);
|
||||||
10); // GitLab instance is located in Ukraine. Connection times will vary across the world.
|
|
||||||
|
|
||||||
if (_currentGitLabReleaseChannel == null)
|
if (_currentGitLabReleaseChannel == null)
|
||||||
{
|
{
|
||||||
@ -55,7 +52,6 @@ namespace Ryujinx.Ava.Systems
|
|||||||
: releaseChannels.Stable;
|
: releaseChannels.Stable;
|
||||||
|
|
||||||
_changelogUrlFormat = _currentGitLabReleaseChannel.UrlFormat;
|
_changelogUrlFormat = _currentGitLabReleaseChannel.UrlFormat;
|
||||||
_stableUrlFormat = releaseChannels.Stable.UrlFormat;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string fetchedJson = await jsonClient.GetStringAsync(_currentGitLabReleaseChannel.GetLatestReleaseApiUrl());
|
string fetchedJson = await jsonClient.GetStringAsync(_currentGitLabReleaseChannel.GetLatestReleaseApiUrl());
|
||||||
@ -78,7 +74,7 @@ namespace Ryujinx.Ava.Systems
|
|||||||
|
|
||||||
if (userResult is UserResult.Ok)
|
if (userResult is UserResult.Ok)
|
||||||
{
|
{
|
||||||
OpenHelper.OpenUrl(_currentGitLabReleaseChannel.UrlFormat.Format(currentVersion));
|
OpenHelper.OpenUrl(_changelogUrlFormat.Format(currentVersion));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,8 +52,7 @@ namespace Ryujinx.Ava.Systems
|
|||||||
private static bool _running;
|
private static bool _running;
|
||||||
|
|
||||||
private static readonly string[] _windowsDependencyDirs = [];
|
private static readonly string[] _windowsDependencyDirs = [];
|
||||||
|
|
||||||
private static string _stableUrlFormat = null;
|
|
||||||
private static string _changelogUrlFormat = null;
|
private static string _changelogUrlFormat = null;
|
||||||
|
|
||||||
public static async Task<Optional<(Version, Version)>> CheckForUpdateAsync(bool showVersionUpToDate = false)
|
public static async Task<Optional<(Version, Version)>> CheckForUpdateAsync(bool showVersionUpToDate = false)
|
||||||
@ -117,7 +116,9 @@ namespace Ryujinx.Ava.Systems
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
buildSizeClient.DefaultRequestHeaders.Add("Range", "bytes=0-0");
|
buildSizeClient.DefaultRequestHeaders.Add("Range", "bytes=0-0");
|
||||||
buildSizeClient.Timeout = TimeSpan.FromSeconds(10); // GitLab instance is located in Ukraine. Connection times will vary across the world.
|
|
||||||
|
// GitLab instance is located in Ukraine. Connection times will vary across the world.
|
||||||
|
buildSizeClient.Timeout = TimeSpan.FromSeconds(10);
|
||||||
|
|
||||||
HttpResponseMessage message = await buildSizeClient.GetAsync(new Uri(_buildUrl), HttpCompletionOption.ResponseHeadersRead);
|
HttpResponseMessage message = await buildSizeClient.GetAsync(new Uri(_buildUrl), HttpCompletionOption.ResponseHeadersRead);
|
||||||
|
|
||||||
@ -153,7 +154,7 @@ namespace Ryujinx.Ava.Systems
|
|||||||
break;
|
break;
|
||||||
// Secondary button maps to no, which in this case is the show changelog button.
|
// Secondary button maps to no, which in this case is the show changelog button.
|
||||||
case UserResult.No:
|
case UserResult.No:
|
||||||
OpenHelper.OpenUrl(ReleaseInformation.GetChangelogUrl(currentVersion, newVersion, _stableUrlFormat.Format(currentVersion)));
|
OpenHelper.OpenUrl(ReleaseInformation.GetChangelogUrl(currentVersion, newVersion));
|
||||||
goto RequestUserToUpdate;
|
goto RequestUserToUpdate;
|
||||||
default:
|
default:
|
||||||
_running = false;
|
_running = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user