diff --git a/src/Ryujinx.Common/ReleaseInformation.cs b/src/Ryujinx.Common/ReleaseInformation.cs index 07b0ebbb2..a5beb1009 100644 --- a/src/Ryujinx.Common/ReleaseInformation.cs +++ b/src/Ryujinx.Common/ReleaseInformation.cs @@ -32,10 +32,10 @@ namespace Ryujinx.Common public static string Version => IsValid ? BuildVersion : Assembly.GetEntryAssembly()!.GetCustomAttribute()?.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}"; } diff --git a/src/Ryujinx/Systems/Updater/Updater.GitHub.cs b/src/Ryujinx/Systems/Updater/Updater.GitHub.cs index 49c09ba5a..07724520a 100644 --- a/src/Ryujinx/Systems/Updater/Updater.GitHub.cs +++ b/src/Ryujinx/Systems/Updater/Updater.GitHub.cs @@ -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)); } } diff --git a/src/Ryujinx/Systems/Updater/Updater.GitLab.cs b/src/Ryujinx/Systems/Updater/Updater.GitLab.cs index 4df1002bb..c52e67cad 100644 --- a/src/Ryujinx/Systems/Updater/Updater.GitLab.cs +++ b/src/Ryujinx/Systems/Updater/Updater.GitLab.cs @@ -19,8 +19,7 @@ namespace Ryujinx.Ava.Systems { private static GitLabReleaseChannels.ChannelType _currentGitLabReleaseChannel; - private static async Task> CheckGitLabVersionAsync( - bool showVersionUpToDate = false) + private static async Task> 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)); } } diff --git a/src/Ryujinx/Systems/Updater/Updater.cs b/src/Ryujinx/Systems/Updater/Updater.cs index c457176c7..c4e8a8cc6 100644 --- a/src/Ryujinx/Systems/Updater/Updater.cs +++ b/src/Ryujinx/Systems/Updater/Updater.cs @@ -52,8 +52,7 @@ namespace Ryujinx.Ava.Systems private static bool _running; private static readonly string[] _windowsDependencyDirs = []; - - private static string _stableUrlFormat = null; + private static string _changelogUrlFormat = null; public static async Task> 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;