summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-07-24 18:29:50 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-09-14 18:54:11 -0400
commite856d5efebe12b3aa65d5868ea7baa59cc54863d (patch)
treee678510fb04ab409d1ec91e6d54761c7357264ff /src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs
parent4fb16abfe9f300b0d841a98b462967b7ca1dcbe5 (diff)
downloadSMAPI-e856d5efebe12b3aa65d5868ea7baa59cc54863d.tar.gz
SMAPI-e856d5efebe12b3aa65d5868ea7baa59cc54863d.tar.bz2
SMAPI-e856d5efebe12b3aa65d5868ea7baa59cc54863d.zip
add remote mod status to update check info (#651)
Diffstat (limited to 'src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs')
-rw-r--r--src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs b/src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs
index 18252298..16885bfd 100644
--- a/src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs
+++ b/src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs
@@ -9,15 +9,18 @@ namespace StardewModdingAPI.Web.Framework.ModRepositories
/// <summary>The mod name.</summary>
public string Name { get; set; }
- /// <summary>The mod's latest release number.</summary>
+ /// <summary>The mod's latest version.</summary>
public string Version { get; set; }
- /// <summary>The mod's latest optional release, if newer than <see cref="Version"/>.</summary>
+ /// <summary>The mod's latest optional or prerelease version, if newer than <see cref="Version"/>.</summary>
public string PreviewVersion { get; set; }
/// <summary>The mod's web URL.</summary>
public string Url { get; set; }
+ /// <summary>The mod availability status.</summary>
+ public RemoteModStatus Status { get; set; } = RemoteModStatus.Ok;
+
/// <summary>The error message indicating why the mod is invalid (if applicable).</summary>
public string Error { get; set; }
@@ -26,31 +29,30 @@ namespace StardewModdingAPI.Web.Framework.ModRepositories
** Public methods
*********/
/// <summary>Construct an empty instance.</summary>
- public ModInfoModel()
- {
- // needed for JSON deserialising
- }
+ public ModInfoModel() { }
/// <summary>Construct an instance.</summary>
/// <param name="name">The mod name.</param>
/// <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>
/// <param name="url">The mod's web URL.</param>
- /// <param name="error">The error message indicating why the mod is invalid (if applicable).</param>
- public ModInfoModel(string name, string version, string url, string previewVersion = null, string error = null)
+ public ModInfoModel(string name, string version, string url, string previewVersion = null)
{
this.Name = name;
this.Version = version;
this.PreviewVersion = previewVersion;
this.Url = url;
- this.Error = error;
}
- /// <summary>Construct an instance.</summary>
- /// <param name="error">The error message indicating why the mod is invalid.</param>
- public ModInfoModel(string error)
+ /// <summary>Set a mod error.</summary>
+ /// <param name="status">The mod availability status.</param>
+ /// <param name="error">The error message indicating why the mod is invalid (if applicable).</param>
+ public ModInfoModel WithError(RemoteModStatus status, string error)
{
+ this.Status = status;
this.Error = error;
+
+ return this;
}
}
}