@@ -27,11 +27,14 @@ public class CompatibilityRepoClient : IDisposable
2727 ** Public methods
2828 *********/
2929 /// <summary>Construct an instance.</summary>
30- /// <param name="fetchUrl ">The full URL of the JSON file to fetch .</param>
30+ /// <param name="fetchBaseUrl ">The base URL from which to fetch the compatibility list JSON files .</param>
3131 /// <param name="userAgent">The user agent for the API client.</param>
32- public CompatibilityRepoClient ( string userAgent , string fetchUrl = "https://raw.githubusercontent.com/Pathoschild/SmapiCompatibilityList/refs/heads/release/data/data.jsonc " )
32+ public CompatibilityRepoClient ( string userAgent , string fetchBaseUrl = "https://raw.githubusercontent.com/Pathoschild/SmapiCompatibilityList/refs/heads/release/data" )
3333 {
34- this . Client = new FluentClient ( fetchUrl ) . SetUserAgent ( userAgent ) ;
34+ this . Client = new FluentClient ( fetchBaseUrl )
35+ . SetUserAgent ( userAgent ) ;
36+ this . Client . Filters . Add ( new ForceJsonResponseTypeFilter ( ) ) ;
37+
3538 this . MarkdownPipeline = new MarkdownPipelineBuilder ( )
3639 . Use ( new ExpandCompatibilityListAnchorLinksExtension ( ) )
3740 . Build ( ) ;
@@ -40,14 +43,12 @@ public CompatibilityRepoClient(string userAgent, string fetchUrl = "https://raw.
4043 /// <summary>Fetch mods from the compatibility list.</summary>
4144 public async Task < ModCompatibilityEntry [ ] > FetchModsAsync ( )
4245 {
43- RawCompatibilityList response = await this . Client
44- . GetAsync ( null )
45- . WithFilter ( new ForceJsonResponseTypeFilter ( ) )
46- . As < RawCompatibilityList > ( ) ;
46+ RawCompatibilityList mods = await this . Client . GetAsync ( "mods.jsonc" ) . As < RawCompatibilityList > ( ) ;
47+ RawCompatibilityList brokenContentPacks = await this . Client . GetAsync ( "broken-content-packs.jsonc" ) . As < RawCompatibilityList > ( ) ;
4748
4849 return
49- ( response . Mods ?? Array . Empty < RawModEntry > ( ) )
50- . Concat ( response . BrokenContentPacks ?? Array . Empty < RawModEntry > ( ) )
50+ ( mods . Mods ?? Array . Empty < RawModEntry > ( ) )
51+ . Concat ( brokenContentPacks . BrokenContentPacks ?? Array . Empty < RawModEntry > ( ) )
5152 . Select ( this . ParseRawModEntry )
5253 . ToArray ( ) ;
5354 }
0 commit comments