use changelog url format variable in more places + remove stable url format variable

This commit is contained in:
GreemDev 2025-06-03 18:17:02 -05:00
parent 91248bdd32
commit c9116e2a52
4 changed files with 13 additions and 17 deletions

View File

@ -32,10 +32,10 @@ namespace Ryujinx.Common
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
? $"https://git.ryujinx.app/ryubing/ryujinx/-/compare/Canary-{currentVersion}...Canary-{newVersion}"
: stableUrl;
: $"https://git.ryujinx.app/ryubing/ryujinx/-/releases/{newVersion}";
}

View File

@ -49,7 +49,6 @@ namespace Ryujinx.Ava.Systems
: releaseChannels.Stable;
_changelogUrlFormat = _currentGitHubReleaseChannel.Value.UrlFormat;
_stableUrlFormat = releaseChannels.Stable.UrlFormat;
}
string fetchedJson = await jsonClient.GetStringAsync(_currentGitHubReleaseChannel.Value.GetLatestReleaseApiUrl());
@ -72,7 +71,7 @@ namespace Ryujinx.Ava.Systems
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)
{
OpenHelper.OpenUrl(_currentGitHubReleaseChannel.Value.UrlFormat.Format(currentVersion));
OpenHelper.OpenUrl(_changelogUrlFormat.Format(currentVersion));
}
}

View File

@ -19,8 +19,7 @@ namespace Ryujinx.Ava.Systems
{
private static GitLabReleaseChannels.ChannelType _currentGitLabReleaseChannel;
private static async Task<Optional<(Version Current, Version Incoming)>> CheckGitLabVersionAsync(
bool showVersionUpToDate = false)
private static async Task<Optional<(Version Current, Version Incoming)>> CheckGitLabVersionAsync(bool showVersionUpToDate = false)
{
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.");
// Get latest version number from GitLab API
using HttpClient jsonClient = ConstructHttpClient();
jsonClient.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.
jsonClient.Timeout = TimeSpan.FromSeconds(10);
if (_currentGitLabReleaseChannel == null)
{
@ -55,7 +52,6 @@ namespace Ryujinx.Ava.Systems
: releaseChannels.Stable;
_changelogUrlFormat = _currentGitLabReleaseChannel.UrlFormat;
_stableUrlFormat = releaseChannels.Stable.UrlFormat;
}
string fetchedJson = await jsonClient.GetStringAsync(_currentGitLabReleaseChannel.GetLatestReleaseApiUrl());
@ -78,7 +74,7 @@ namespace Ryujinx.Ava.Systems
if (userResult is UserResult.Ok)
{
OpenHelper.OpenUrl(_currentGitLabReleaseChannel.UrlFormat.Format(currentVersion));
OpenHelper.OpenUrl(_changelogUrlFormat.Format(currentVersion));
}
}

View File

@ -53,7 +53,6 @@ namespace Ryujinx.Ava.Systems
private static readonly string[] _windowsDependencyDirs = [];
private static string _stableUrlFormat = null;
private static string _changelogUrlFormat = null;
public static async Task<Optional<(Version, Version)>> CheckForUpdateAsync(bool showVersionUpToDate = false)
@ -117,7 +116,9 @@ namespace Ryujinx.Ava.Systems
try
{
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);
@ -153,7 +154,7 @@ namespace Ryujinx.Ava.Systems
break;
// Secondary button maps to no, which in this case is the show changelog button.
case UserResult.No:
OpenHelper.OpenUrl(ReleaseInformation.GetChangelogUrl(currentVersion, newVersion, _stableUrlFormat.Format(currentVersion)));
OpenHelper.OpenUrl(ReleaseInformation.GetChangelogUrl(currentVersion, newVersion));
goto RequestUserToUpdate;
default:
_running = false;