diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-07-19 13:15:45 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-09-14 18:52:58 -0400 |
commit | ce6cedaf4be53d52f2e558055b91e515b92e4c83 (patch) | |
tree | 2984ef22c225e25221c080eb0b26466d99aae1b6 /src/SMAPI.Web/ViewModels | |
parent | 88110dffbf4bace738e8f29133bfb3ac4b265e2c (diff) | |
download | SMAPI-ce6cedaf4be53d52f2e558055b91e515b92e4c83.tar.gz SMAPI-ce6cedaf4be53d52f2e558055b91e515b92e4c83.tar.bz2 SMAPI-ce6cedaf4be53d52f2e558055b91e515b92e4c83.zip |
add background fetch for mod compatibility list (#651)
Diffstat (limited to 'src/SMAPI.Web/ViewModels')
-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; } } } |