summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Controllers
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-10-20 20:19:12 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-10-20 20:19:12 -0400
commitde561e52d7785597f1af2c6fd0d712d19ac5f928 (patch)
tree45d542f4d89f86a87d5828a209b85135e053a3ad /src/SMAPI.Web/Controllers
parentb729ef012925ca00f2f9b4c6a2091d6cf78b239c (diff)
downloadSMAPI-de561e52d7785597f1af2c6fd0d712d19ac5f928.tar.gz
SMAPI-de561e52d7785597f1af2c6fd0d712d19ac5f928.tar.bz2
SMAPI-de561e52d7785597f1af2c6fd0d712d19ac5f928.zip
fetch game versions from the wiki (#597)
Diffstat (limited to 'src/SMAPI.Web/Controllers')
-rw-r--r--src/SMAPI.Web/Controllers/ModsApiController.cs2
-rw-r--r--src/SMAPI.Web/Controllers/ModsController.cs9
2 files changed, 6 insertions, 5 deletions
diff --git a/src/SMAPI.Web/Controllers/ModsApiController.cs b/src/SMAPI.Web/Controllers/ModsApiController.cs
index 5caa5758..6e517a97 100644
--- a/src/SMAPI.Web/Controllers/ModsApiController.cs
+++ b/src/SMAPI.Web/Controllers/ModsApiController.cs
@@ -223,7 +223,7 @@ namespace StardewModdingAPI.Web.Controllers
{
try
{
- WikiModEntry[] entries = await toolkit.GetWikiCompatibilityListAsync();
+ WikiModEntry[] entries = (await toolkit.GetWikiCompatibilityListAsync()).Mods;
entry.AbsoluteExpiration = DateTimeOffset.UtcNow.AddMinutes(this.SuccessCacheMinutes);
return entries;
}
diff --git a/src/SMAPI.Web/Controllers/ModsController.cs b/src/SMAPI.Web/Controllers/ModsController.cs
index f258c745..57aa9da9 100644
--- a/src/SMAPI.Web/Controllers/ModsController.cs
+++ b/src/SMAPI.Web/Controllers/ModsController.cs
@@ -56,11 +56,12 @@ namespace StardewModdingAPI.Web.Controllers
{
return await this.Cache.GetOrCreateAsync($"{nameof(ModsController)}_mod_list", async entry =>
{
- WikiModEntry[] entries = await new ModToolkit().GetWikiCompatibilityListAsync();
+ WikiModList data = await new ModToolkit().GetWikiCompatibilityListAsync();
ModListModel model = new ModListModel(
- stableVersion: "1.3.28",
- betaVersion: "1.3.31-beta",
- mods: entries
+ stableVersion: data.StableVersion,
+ betaVersion: data.BetaVersion,
+ mods: data
+ .Mods
.Select(mod => new ModModel(mod))
.OrderBy(p => Regex.Replace(p.Name.ToLower(), "[^a-z0-9]", "")) // ignore case, spaces, and special characters when sorting
);