diff options
Diffstat (limited to 'src/SMAPI.Web/ViewModels/ModListModel.cs')
-rw-r--r-- | src/SMAPI.Web/ViewModels/ModListModel.cs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/SMAPI.Web/ViewModels/ModListModel.cs b/src/SMAPI.Web/ViewModels/ModListModel.cs index 3b87d393..ff7513bc 100644 --- a/src/SMAPI.Web/ViewModels/ModListModel.cs +++ b/src/SMAPI.Web/ViewModels/ModListModel.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; @@ -18,19 +19,35 @@ namespace StardewModdingAPI.Web.ViewModels /// <summary>The mods to display.</summary> public ModModel[] Mods { get; set; } + /// <summary>When the data was last updated.</summary> + public DateTimeOffset LastUpdated { get; set; } + + /// <summary>Whether the data hasn't been updated in a while.</summary> + public bool IsStale { get; set; } + + /// <summary>Whether the mod metadata is available.</summary> + public bool HasData => this.Mods != null; + /********* ** Public methods *********/ + /// <summary>Construct an empty instance.</summary> + public ModListModel() { } + /// <summary>Construct an instance.</summary> /// <param name="stableVersion">The current stable version of the game.</param> /// <param name="betaVersion">The current beta version of the game (if any).</param> /// <param name="mods">The mods to display.</param> - public ModListModel(string stableVersion, string betaVersion, IEnumerable<ModModel> mods) + /// <param name="lastUpdated">When the data was last updated.</param> + /// <param name="isStale">Whether the data hasn't been updated in a while.</param> + public ModListModel(string stableVersion, string betaVersion, IEnumerable<ModModel> mods, DateTimeOffset lastUpdated, bool isStale) { this.StableVersion = stableVersion; this.BetaVersion = betaVersion; this.Mods = mods.ToArray(); + this.LastUpdated = lastUpdated; + this.IsStale = isStale; } } } |