summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Controllers/ModsController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Web/Controllers/ModsController.cs')
-rw-r--r--src/SMAPI.Web/Controllers/ModsController.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/SMAPI.Web/Controllers/ModsController.cs b/src/SMAPI.Web/Controllers/ModsController.cs
index b621ded0..24e36709 100644
--- a/src/SMAPI.Web/Controllers/ModsController.cs
+++ b/src/SMAPI.Web/Controllers/ModsController.cs
@@ -2,6 +2,7 @@ using System.Linq;
using System.Text.RegularExpressions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
+using StardewModdingAPI.Web.Framework.Caching;
using StardewModdingAPI.Web.Framework.Caching.Wiki;
using StardewModdingAPI.Web.Framework.ConfigModels;
using StardewModdingAPI.Web.ViewModels;
@@ -51,16 +52,16 @@ namespace StardewModdingAPI.Web.Controllers
public ModListModel FetchData()
{
// fetch cached data
- if (!this.Cache.TryGetWikiMetadata(out CachedWikiMetadata metadata))
+ if (!this.Cache.TryGetWikiMetadata(out Cached<WikiMetadata> metadata))
return new ModListModel();
// build model
return new ModListModel(
- stableVersion: metadata.StableVersion,
- betaVersion: metadata.BetaVersion,
+ stableVersion: metadata.Data.StableVersion,
+ betaVersion: metadata.Data.BetaVersion,
mods: this.Cache
.GetWikiMods()
- .Select(mod => new ModModel(mod.GetModel()))
+ .Select(mod => new ModModel(mod.Data))
.OrderBy(p => Regex.Replace(p.Name.ToLower(), "[^a-z0-9]", "")), // ignore case, spaces, and special characters when sorting
lastUpdated: metadata.LastUpdated,
isStale: this.Cache.IsStale(metadata.LastUpdated, this.StaleMinutes)