Skip to content

Commit 0d056a6

Browse files
committed
Update to .NET 10
1 parent fefac96 commit 0d056a6

11 files changed

Lines changed: 40 additions & 30 deletions

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "9.0.100",
3+
"version": "10.0.100",
44
"rollForward": "latestMinor",
55
"allowPrerelease": false
66
}

src/Client/Ryujinx.Systems.Update.Client.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<PackageId>Ryujinx.UpdateClient</PackageId>

src/Client/UpdateClient/UpdateClient.Admin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public partial class UpdateClient
2222
return null;
2323
}
2424

25-
var httpRequest = new HttpRequestMessage(HttpMethod.Patch, $"{Constants.FullRouteName_Api_Admin_RefreshCache}?rc={rc.AsQueryStringValue()}");
25+
var httpRequest = new HttpRequestMessage(HttpMethod.Patch, $"{Constants.FullRouteName_Api_Admin_RefreshCache}?rc={rc.QueryStringValue}");
2626
ApplyAuthorization(httpRequest);
2727

2828
if (await _http.SendAsync(httpRequest) is { IsSuccessStatusCode: false} resp)

src/Client/UpdateClient/UpdateClient.Download.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,25 @@ public partial class UpdateClient
1717
/// <param name="rc">The desired release channel.</param>
1818
/// <returns>The HTTP response content body as a <see cref="Stream"/>, or null if any non-200 series HTTP status code is returned from the server.</returns>
1919
public async Task<Stream?> DownloadAsync(
20-
string version,
20+
string version,
2121
SupportedPlatform platform,
2222
SupportedArchitecture arch,
2323
ReleaseChannel rc = ReleaseChannel.Stable)
2424
{
2525
var url = $"{Constants.RouteName_Download}/{Constants.QueryRoute}" +
26-
$"?os={platform.AsQueryStringValue()}" +
27-
$"&arch={arch.AsQueryStringValue()}" +
28-
$"&rc={rc.AsQueryStringValue()}" +
26+
$"?os={platform.QueryStringValue}" +
27+
$"&arch={arch.QueryStringValue}" +
28+
$"&rc={rc.QueryStringValue}" +
2929
$"&version={version}";
30-
30+
3131
Log("Downloading the file from: {0}", [QualifyUriPath(url)]);
32-
32+
3333
var resp = await _http.GetAsync(url);
3434

3535
if (!resp.IsSuccessStatusCode)
3636
{
37-
Log("Received non-success status code ({0}) for download query!", [Enum.GetName(resp.StatusCode) ?? $"{(int)resp.StatusCode}"]);
37+
Log("Received non-success status code ({0}) for download query!",
38+
[Enum.GetName(resp.StatusCode) ?? $"{(int)resp.StatusCode}"]);
3839
return null;
3940
}
4041

src/Client/UpdateClient/UpdateClient.Latest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ public partial class UpdateClient
2323
ReleaseChannel rc = ReleaseChannel.Stable)
2424
{
2525
var url = $"{Constants.RouteName_Latest}/{Constants.QueryRoute}" +
26-
$"?os={platform.AsQueryStringValue()}" +
27-
$"&arch={arch.AsQueryStringValue()}" +
28-
$"&rc={rc.AsQueryStringValue()}";
26+
$"?os={platform.QueryStringValue}" +
27+
$"&arch={arch.QueryStringValue}" +
28+
$"&rc={rc.QueryStringValue}";
2929

3030
Log("Checking for updates from: {0}", [QualifyUriPath(url)]);
3131

src/Common/Enums/ReleaseChannel.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ public enum ReleaseChannel
88

99
public static partial class EnumExtensions
1010
{
11-
public static string AsQueryStringValue(this ReleaseChannel rc) =>
12-
Enum.GetName(rc)?.ToLower() ?? throw new ArgumentOutOfRangeException(nameof(rc));
11+
extension(ReleaseChannel rc)
12+
{
13+
public string QueryStringValue => Enum.GetName(rc)?.ToLower() ?? throw new ArgumentOutOfRangeException(nameof(rc));
14+
}
1315

1416
public static bool TryParseAsReleaseChannel(this string? rawRc, out ReleaseChannel rc)
1517
{

src/Common/Enums/SupportedArchitecture.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ public enum SupportedArchitecture
88

99
public static partial class EnumExtensions
1010
{
11-
public static string AsQueryStringValue(this SupportedArchitecture arch) =>
12-
Enum.GetName(arch)?.ToLower() ?? throw new ArgumentOutOfRangeException(nameof(arch));
11+
extension(SupportedArchitecture arch)
12+
{
13+
public string QueryStringValue =>
14+
Enum.GetName(arch)?.ToLower() ?? throw new ArgumentOutOfRangeException(nameof(arch));
15+
}
1316

1417
public static bool TryParseAsSupportedArchitecture(this string? rawArch, out SupportedArchitecture arch)
1518
{

src/Common/Enums/SupportedPlatform.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ public enum SupportedPlatform
1010

1111
public static partial class EnumExtensions
1212
{
13-
public static string AsQueryStringValue(this SupportedPlatform supportedPlatform) => supportedPlatform switch
13+
extension(SupportedPlatform platform)
1414
{
15-
SupportedPlatform.Windows => "win",
16-
SupportedPlatform.Linux => "linux",
17-
SupportedPlatform.Mac => "mac",
18-
_ => throw new ArgumentOutOfRangeException(nameof(supportedPlatform))
19-
};
15+
public string QueryStringValue => platform switch
16+
{
17+
SupportedPlatform.Windows => "win",
18+
SupportedPlatform.Linux => "linux",
19+
SupportedPlatform.LinuxAppImage => "linuxappimage",
20+
SupportedPlatform.Mac => "mac",
21+
_ => throw new ArgumentOutOfRangeException(nameof(platform))
22+
};
23+
}
2024

2125
public static bool TryParseAsSupportedPlatform(this string? os, out SupportedPlatform platform)
2226
{

src/Common/Ryujinx.Systems.Update.Common.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

src/Server/Helpers/Extensions/ServiceProviderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ namespace Ryujinx.Systems.Update.Server;
66
public static class ServiceProviderExtensions
77
{
88
public static VersionCache GetCacheFor(this IServiceProvider serviceProvider, ReleaseChannel rc)
9-
=> serviceProvider.GetRequiredKeyedService<VersionCache>($"{rc.AsQueryStringValue()}Cache");
9+
=> serviceProvider.GetRequiredKeyedService<VersionCache>($"{rc.QueryStringValue}Cache");
1010
}

0 commit comments

Comments
 (0)