summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/ViewModels
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-03-26 09:35:34 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-03-26 09:35:34 -0400
commit46141a7af21a921284bc82d49d888da864887d6e (patch)
treec71d17897377725f32653eacc65233f0b848f813 /src/SMAPI.Web/ViewModels
parentafb3c49bbaab07f3148f70d54f5140cdd83f8c20 (diff)
parent4d68ef3514de7deb357a0042d1af7ccf241ab5ff (diff)
downloadSMAPI-46141a7af21a921284bc82d49d888da864887d6e.tar.gz
SMAPI-46141a7af21a921284bc82d49d888da864887d6e.tar.bz2
SMAPI-46141a7af21a921284bc82d49d888da864887d6e.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Web/ViewModels')
-rw-r--r--src/SMAPI.Web/ViewModels/IndexModel.cs28
-rw-r--r--src/SMAPI.Web/ViewModels/IndexVersionModel.cs41
2 files changed, 50 insertions, 19 deletions
diff --git a/src/SMAPI.Web/ViewModels/IndexModel.cs b/src/SMAPI.Web/ViewModels/IndexModel.cs
index 6d3da91e..4268c878 100644
--- a/src/SMAPI.Web/ViewModels/IndexModel.cs
+++ b/src/SMAPI.Web/ViewModels/IndexModel.cs
@@ -6,17 +6,11 @@ namespace StardewModdingAPI.Web.ViewModels
/*********
** Accessors
*********/
- /// <summary>The latest SMAPI version.</summary>
- public string LatestVersion { get; set; }
+ /// <summary>The latest stable SMAPI version.</summary>
+ public IndexVersionModel StableVersion { get; set; }
- /// <summary>The Markdown description for the release.</summary>
- public string Description { get; set; }
-
- /// <summary>The main download URL.</summary>
- public string DownloadUrl { get; set; }
-
- /// <summary>The for-developers download URL.</summary>
- public string DevDownloadUrl { get; set; }
+ /// <summary>The latest prerelease SMAPI version (if newer than <see cref="StableVersion"/>).</summary>
+ public IndexVersionModel BetaVersion { get; set; }
/*********
@@ -26,16 +20,12 @@ namespace StardewModdingAPI.Web.ViewModels
public IndexModel() { }
/// <summary>Construct an instance.</summary>
- /// <param name="latestVersion">The latest SMAPI version.</param>
- /// <param name="description">The Markdown description for the release.</param>
- /// <param name="downloadUrl">The main download URL.</param>
- /// <param name="devDownloadUrl">The for-developers download URL.</param>
- internal IndexModel(string latestVersion, string description, string downloadUrl, string devDownloadUrl)
+ /// <param name="stableVersion">The latest stable SMAPI version.</param>
+ /// <param name="betaVersion">The latest prerelease SMAPI version (if newer than <paramref name="stableVersion"/>).</param>
+ internal IndexModel(IndexVersionModel stableVersion, IndexVersionModel betaVersion)
{
- this.LatestVersion = latestVersion;
- this.Description = description;
- this.DownloadUrl = downloadUrl;
- this.DevDownloadUrl = devDownloadUrl;
+ this.StableVersion = stableVersion;
+ this.BetaVersion = betaVersion;
}
}
}
diff --git a/src/SMAPI.Web/ViewModels/IndexVersionModel.cs b/src/SMAPI.Web/ViewModels/IndexVersionModel.cs
new file mode 100644
index 00000000..4f63b979
--- /dev/null
+++ b/src/SMAPI.Web/ViewModels/IndexVersionModel.cs
@@ -0,0 +1,41 @@
+namespace StardewModdingAPI.Web.ViewModels
+{
+ /// <summary>The fields for a SMAPI version.</summary>
+ public class IndexVersionModel
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>The release version.</summary>
+ public string Version { get; set; }
+
+ /// <summary>The Markdown description for the release.</summary>
+ public string Description { get; set; }
+
+ /// <summary>The main download URL.</summary>
+ public string DownloadUrl { get; set; }
+
+ /// <summary>The for-developers download URL (not applicable for prerelease versions).</summary>
+ public string DevDownloadUrl { get; set; }
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct an instance.</summary>
+ public IndexVersionModel() { }
+
+ /// <summary>Construct an instance.</summary>
+ /// <param name="version">The release number.</param>
+ /// <param name="description">The Markdown description for the release.</param>
+ /// <param name="downloadUrl">The main download URL.</param>
+ /// <param name="devDownloadUrl">The for-developers download URL (not applicable for prerelease versions).</param>
+ internal IndexVersionModel(string version, string description, string downloadUrl, string devDownloadUrl)
+ {
+ this.Version = version;
+ this.Description = description;
+ this.DownloadUrl = downloadUrl;
+ this.DevDownloadUrl = devDownloadUrl;
+ }
+ }
+}