diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-06-06 00:02:30 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-06-06 00:02:30 -0400 |
commit | aee42562698ad3e84f781d51e8aa5017a1a589bc (patch) | |
tree | 49514253617adcfd842f5085f2b7b467d50d2348 /src | |
parent | 6eba10948bf39d5e05505ec060f6920f84610d58 (diff) | |
download | SMAPI-aee42562698ad3e84f781d51e8aa5017a1a589bc.tar.gz SMAPI-aee42562698ad3e84f781d51e8aa5017a1a589bc.tar.bz2 SMAPI-aee42562698ad3e84f781d51e8aa5017a1a589bc.zip |
remove obsolete Nexus API client
Diffstat (limited to 'src')
-rw-r--r-- | src/SMAPI.Web/Framework/Clients/Nexus/NexusClient.cs | 48 | ||||
-rw-r--r-- | src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs | 6 | ||||
-rw-r--r-- | src/SMAPI.Web/Startup.cs | 5 | ||||
-rw-r--r-- | src/SMAPI.Web/appsettings.json | 1 |
4 files changed, 0 insertions, 60 deletions
diff --git a/src/SMAPI.Web/Framework/Clients/Nexus/NexusClient.cs b/src/SMAPI.Web/Framework/Clients/Nexus/NexusClient.cs deleted file mode 100644 index adec41be..00000000 --- a/src/SMAPI.Web/Framework/Clients/Nexus/NexusClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Threading.Tasks; -using Pathoschild.Http.Client; - -namespace StardewModdingAPI.Web.Framework.Clients.Nexus -{ - /// <summary>An HTTP client for fetching mod metadata from the Nexus Mods API.</summary> - internal class NexusClient : INexusClient - { - /********* - ** Properties - *********/ - /// <summary>The URL for a Nexus Mods API query excluding the base URL, where {0} is the mod ID.</summary> - private readonly string ModUrlFormat; - - /// <summary>The underlying HTTP client.</summary> - private readonly IClient Client; - - - /********* - ** Public methods - *********/ - /// <summary>Construct an instance.</summary> - /// <param name="userAgent">The user agent for the Nexus Mods API client.</param> - /// <param name="baseUrl">The base URL for the Nexus Mods API.</param> - /// <param name="modUrlFormat">The URL for a Nexus Mods API query excluding the <paramref name="baseUrl"/>, where {0} is the mod ID.</param> - public NexusClient(string userAgent, string baseUrl, string modUrlFormat) - { - this.ModUrlFormat = modUrlFormat; - this.Client = new FluentClient(baseUrl).SetUserAgent(userAgent); - } - - /// <summary>Get metadata about a mod.</summary> - /// <param name="id">The Nexus mod ID.</param> - /// <returns>Returns the mod info if found, else <c>null</c>.</returns> - public async Task<NexusMod> GetModAsync(uint id) - { - return await this.Client - .GetAsync(string.Format(this.ModUrlFormat, id)) - .As<NexusMod>(); - } - - /// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary> - public void Dispose() - { - this.Client?.Dispose(); - } - } -} diff --git a/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs index de6c024a..9452fdf9 100644 --- a/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs +++ b/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs @@ -47,9 +47,6 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels /**** ** Nexus Mods ****/ - /// <summary>The user agent for the Nexus Mods API client.</summary> - public string NexusUserAgent { get; set; } - /// <summary>The base URL for the Nexus Mods API.</summary> public string NexusBaseUrl { get; set; } @@ -62,9 +59,6 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels /// <summary>The base URL for the Pastebin API.</summary> public string PastebinBaseUrl { get; set; } - /// <summary>The user agent for the Pastebin API client, where {0} is the SMAPI version.</summary> - public string PastebinUserAgent { get; set; } - /// <summary>The user key used to authenticate with the Pastebin API.</summary> public string PastebinUserKey { get; set; } diff --git a/src/SMAPI.Web/Startup.cs b/src/SMAPI.Web/Startup.cs index 82a0f4f6..2019d6db 100644 --- a/src/SMAPI.Web/Startup.cs +++ b/src/SMAPI.Web/Startup.cs @@ -82,11 +82,6 @@ namespace StardewModdingAPI.Web password: api.GitHubPassword )); - //services.AddSingleton<INexusClient>(new NexusClient( - // userAgent: api.NexusUserAgent, - // baseUrl: api.NexusBaseUrl, - // modUrlFormat: api.NexusModUrlFormat - //)); services.AddSingleton<INexusClient>(new NexusWebScrapeClient( userAgent: userAgent, baseUrl: api.NexusBaseUrl, diff --git a/src/SMAPI.Web/appsettings.json b/src/SMAPI.Web/appsettings.json index 09c7d1c2..fda77183 100644 --- a/src/SMAPI.Web/appsettings.json +++ b/src/SMAPI.Web/appsettings.json @@ -30,7 +30,6 @@ "GitHubUsername": null, // see top note "GitHubPassword": null, // see top note - "NexusUserAgent": "Nexus Client v0.63.15", "NexusBaseUrl": "https://www.nexusmods.com/stardewvalley/", "NexusModUrlFormat": "mods/{0}", |