summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/ModInfoModel.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2023-04-09 13:12:30 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2023-04-09 13:12:30 -0400
commit5486146a05dec8a5c09e9585e5b610b89feaf731 (patch)
tree52c91cb3c4349976ec77877b963d444cadd4587c /src/SMAPI.Web/Framework/ModInfoModel.cs
parent53e0e8cd2410e63c7725206db4a8156cc460d111 (diff)
parenta4b193b920879b7db255f387af8e3c9b4fa2b46a (diff)
downloadSMAPI-5486146a05dec8a5c09e9585e5b610b89feaf731.tar.gz
SMAPI-5486146a05dec8a5c09e9585e5b610b89feaf731.tar.bz2
SMAPI-5486146a05dec8a5c09e9585e5b610b89feaf731.zip
Merge pull request #876 from jltaylor-us/update-manifest
Add `UpdateManifest` update keys
Diffstat (limited to 'src/SMAPI.Web/Framework/ModInfoModel.cs')
-rw-r--r--src/SMAPI.Web/Framework/ModInfoModel.cs30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/SMAPI.Web/Framework/ModInfoModel.cs b/src/SMAPI.Web/Framework/ModInfoModel.cs
index e70b60bf..502c0827 100644
--- a/src/SMAPI.Web/Framework/ModInfoModel.cs
+++ b/src/SMAPI.Web/Framework/ModInfoModel.cs
@@ -27,6 +27,12 @@ namespace StardewModdingAPI.Web.Framework
/// <summary>The error message indicating why the mod is invalid (if applicable).</summary>
public string? Error { get; private set; }
+ /// <summary>The mod page URL from which <see cref="Version"/> can be downloaded, if different from the <see cref="Url"/>.</summary>
+ public string? MainModPageUrl { get; private set; }
+
+ /// <summary>The mod page URL from which <see cref="PreviewVersion"/> can be downloaded, if different from the <see cref="Url"/>.</summary>
+ public string? PreviewModPageUrl { get; private set; }
+
/*********
** Public methods
@@ -46,7 +52,8 @@ namespace StardewModdingAPI.Web.Framework
{
this
.SetBasicInfo(name, url)
- .SetVersions(version!, previewVersion)
+ .SetMainVersion(version!)
+ .SetPreviewVersion(previewVersion)
.SetError(status, error!);
}
@@ -62,14 +69,25 @@ namespace StardewModdingAPI.Web.Framework
return this;
}
- /// <summary>Set the mod version info.</summary>
- /// <param name="version">The semantic version for the mod's latest release.</param>
- /// <param name="previewVersion">The semantic version for the mod's latest preview release, if available and different from <see cref="Version"/>.</param>
+ /// <summary>Set the mod's main version info.</summary>
+ /// <param name="version">The semantic version for the mod's latest stable release.</param>
+ /// <param name="modPageUrl">The mod page URL from which <paramref name="version"/> can be downloaded, if different from the <see cref="Url"/>.</param>
[MemberNotNull(nameof(ModInfoModel.Version))]
- public ModInfoModel SetVersions(ISemanticVersion version, ISemanticVersion? previewVersion = null)
+ public ModInfoModel SetMainVersion(ISemanticVersion version, string? modPageUrl = null)
{
this.Version = version;
- this.PreviewVersion = previewVersion;
+ this.MainModPageUrl = modPageUrl;
+
+ return this;
+ }
+
+ /// <summary>Set the mod's preview version info.</summary>
+ /// <param name="version">The semantic version for the mod's latest preview release.</param>
+ /// <param name="modPageUrl">The mod page URL from which <paramref name="version"/> can be downloaded, if different from the <see cref="Url"/>.</param>
+ public ModInfoModel SetPreviewVersion(ISemanticVersion? version, string? modPageUrl = null)
+ {
+ this.PreviewVersion = version;
+ this.PreviewModPageUrl = modPageUrl;
return this;
}