11using Microsoft . AspNetCore . Mvc ;
22using Ryujinx . Systems . Update . Common ;
3- using Ryujinx . Systems . Update . Server . Services . GitLab ;
3+ using Ryujinx . Systems . Update . Server . Services . Forgejo ;
44
55namespace Ryujinx . Systems . Update . Server . Controllers ;
66
@@ -14,45 +14,45 @@ public class VersionController : ControllerBase
1414 [ Produces ( "application/json" ) ]
1515 [ EndpointDescription ( "Query the latest Stable Ryubing release build matching the provided query parameters." ) ]
1616 public async Task < ActionResult < VersionResponse > > GetLatestStable (
17- [ FromKeyedServices ( "stableCache" ) ] VersionCache vcache ,
17+ [ FromKeyedServices ( "stableCache" ) ] ForgejoVersionCache vcache ,
1818 [ FromQuery ] string ? os = null ,
1919 [ FromQuery ] string ? arch = null
20- )
20+ )
2121 {
2222 if ( ! os . TryParseAsSupportedPlatform ( out var supportedPlatform ) )
2323 return BadRequest ( $ "Unknown platform '{ os } '") ;
24-
24+
2525 if ( ! arch . TryParseAsSupportedArchitecture ( out var supportedArch ) )
2626 return BadRequest ( $ "Unknown architecture '{ arch } '") ;
27-
28- if ( await vcache . GetReleaseAsync ( c => c . GetLatest ( supportedPlatform , supportedArch ) ) is not { } latest )
27+
28+ if ( await vcache . GetReleaseAsync ( c => c . GetLatest ( supportedPlatform , supportedArch ) ) is not { } latest )
2929 return NotFound ( ) ;
30-
30+
3131 return Ok ( new VersionResponse
3232 {
3333 Version = latest . Tag ,
3434 ArtifactUrl = latest . GetUrlFor ( supportedPlatform , supportedArch ) ,
3535 ReleaseUrlFormat = vcache . ReleaseUrlFormat
3636 } ) ;
3737 }
38-
38+
3939 [ HttpGet ( $ "{ Constants . CanaryRoute } /{ Constants . RouteName_Latest } ") ]
4040 [ ProducesResponseType ( StatusCodes . Status404NotFound ) ]
4141 [ ProducesResponseType ( StatusCodes . Status200OK ) ]
4242 [ Produces ( "application/json" ) ]
4343 [ EndpointDescription ( "Query the latest Canary Ryubing release build matching the provided query parameters." ) ]
4444 public async Task < ActionResult < VersionResponse > > GetLatestCanary (
45- [ FromKeyedServices ( "canaryCache" ) ] VersionCache vcache ,
45+ [ FromKeyedServices ( "canaryCache" ) ] ForgejoVersionCache vcache ,
4646 [ FromQuery ] string ? os = null ,
4747 [ FromQuery ] string ? arch = null
4848 )
4949 {
5050 if ( ! os . TryParseAsSupportedPlatform ( out var supportedPlatform ) )
5151 return BadRequest ( $ "Unknown platform '{ os } '") ;
52-
52+
5353 if ( ! arch . TryParseAsSupportedArchitecture ( out var supportedArch ) )
5454 return BadRequest ( $ "Unknown architecture '{ arch } '") ;
55-
55+
5656 if ( await vcache . GetReleaseAsync ( c => c . GetLatest ( supportedPlatform , supportedArch ) ) is not { } latest )
5757 return NotFound ( ) ;
5858
@@ -63,36 +63,36 @@ public async Task<ActionResult<VersionResponse>> GetLatestCanary(
6363 ReleaseUrlFormat = vcache . ReleaseUrlFormat
6464 } ) ;
6565 }
66-
66+
6767 [ HttpGet ( $ "{ Constants . StableRoute } /{{version}}") ]
6868 [ ProducesResponseType ( StatusCodes . Status404NotFound ) ]
6969 [ ProducesResponseType ( StatusCodes . Status200OK ) ]
7070 [ Produces ( "application/json" ) ]
7171 [ EndpointDescription ( "Query a specific Stable Ryubing version cache entry." ) ]
7272 public async Task < ActionResult < VersionCacheEntry > > GetSpecificStable (
73- [ FromKeyedServices ( "stableCache" ) ] VersionCache vcache ,
73+ [ FromKeyedServices ( "stableCache" ) ] ForgejoVersionCache vcache ,
7474 string version
7575 )
7676 {
7777 if ( await vcache . GetReleaseAsync ( c => c [ version ] ) is { } cacheEntry )
7878 return Ok ( cacheEntry ) ;
79-
79+
8080 return NotFound ( ) ;
8181 }
82-
82+
8383 [ HttpGet ( $ "{ Constants . CanaryRoute } /{{version}}") ]
8484 [ ProducesResponseType ( StatusCodes . Status404NotFound ) ]
8585 [ ProducesResponseType ( StatusCodes . Status200OK ) ]
8686 [ Produces ( "application/json" ) ]
8787 [ EndpointDescription ( "Query a specific Canary Ryubing version cache entry." ) ]
8888 public async Task < ActionResult < VersionCacheEntry > > GetSpecificCanary (
89- [ FromKeyedServices ( "canaryCache" ) ] VersionCache vcache ,
89+ [ FromKeyedServices ( "canaryCache" ) ] ForgejoVersionCache vcache ,
9090 string version
9191 )
9292 {
9393 if ( await vcache . GetReleaseAsync ( c => c [ version ] ) is { } cacheEntry )
9494 return Ok ( cacheEntry ) ;
95-
95+
9696 return NotFound ( ) ;
9797 }
9898}
0 commit comments