forgot some things & remove redundant method on github release channel

This commit is contained in:
GreemDev 2025-06-03 02:55:25 -05:00
parent 0df51e24dd
commit 72935bdbb6
2 changed files with 4 additions and 8 deletions

View file

@ -18,8 +18,6 @@ namespace Ryujinx.Ava.Systems
{ {
private static GitHubReleaseChannels.Channel? _currentGitHubReleaseChannel; private static GitHubReleaseChannels.Channel? _currentGitHubReleaseChannel;
private const string GitHubApiUrl = "https://api.github.com";
public static async Task<Optional<(Version Current, Version Incoming)>> CheckGitHubVersionAsync(bool showVersionUpToDate = false) public static async Task<Optional<(Version Current, Version Incoming)>> CheckGitHubVersionAsync(bool showVersionUpToDate = false)
{ {
if (!Version.TryParse(Program.Version, out Version currentVersion)) if (!Version.TryParse(Program.Version, out Version currentVersion))
@ -74,7 +72,7 @@ namespace Ryujinx.Ava.Systems
if (userResult is UserResult.Ok) if (userResult is UserResult.Ok)
{ {
OpenHelper.OpenUrl(_currentGitHubReleaseChannel.Value.GetSpecificReleaseUrl(currentVersion)); OpenHelper.OpenUrl(_currentGitHubReleaseChannel.Value.UrlFormat.Format(currentVersion));
} }
} }
@ -100,7 +98,7 @@ namespace Ryujinx.Ava.Systems
if (userResult is UserResult.Ok) if (userResult is UserResult.Ok)
{ {
OpenHelper.OpenUrl(_currentGitHubReleaseChannel.Value.GetSpecificReleaseUrl(currentVersion)); OpenHelper.OpenUrl(_currentGitHubReleaseChannel.Value.UrlFormat.Format(currentVersion));
} }
} }
@ -169,14 +167,12 @@ namespace Ryujinx.Ava.Systems
public readonly string Owner; public readonly string Owner;
public readonly string Repo; public readonly string Repo;
public string UrlFormat => $"https://github.com/{ToString()}/releases/{0}"; public string UrlFormat => $"https://github.com/{ToString()}/releases/{{0}}";
public override string ToString() => $"{Owner}/{Repo}"; public override string ToString() => $"{Owner}/{Repo}";
public string GetLatestReleaseApiUrl() => public string GetLatestReleaseApiUrl() =>
$"https://api.github.com/repos/{ToString()}/releases/latest"; $"https://api.github.com/repos/{ToString()}/releases/latest";
public string GetSpecificReleaseUrl(Version version) => $"https://github.com/{ToString()}/releases/{version}";
} }
} }

View file

@ -77,7 +77,7 @@ namespace Ryujinx.Ava.Systems
if (userResult is UserResult.Ok) if (userResult is UserResult.Ok)
{ {
OpenHelper.OpenUrl(_currentGitHubReleaseChannel.Value.GetSpecificReleaseUrl(currentVersion)); OpenHelper.OpenUrl(_currentGitLabReleaseChannel.UrlFormat.Format(currentVersion));
} }
} }