summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestVersionModel.cs
diff options
context:
space:
mode:
authorJamie Taylor <Jamie.Taylor@pobox.com>2022-10-01 21:09:39 -0400
committerJamie Taylor <Jamie.Taylor@pobox.com>2022-10-01 21:30:14 -0400
commit83aec980b3ee739fb4bc251217556b3ae44f741b (patch)
treeafa8c91eb20cf56ed2cb35563ba3bd2d1e4c8a46 /src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestVersionModel.cs
parent6d4eed56b1d80d02db773b0cd2f372baec6b2d1b (diff)
downloadSMAPI-83aec980b3ee739fb4bc251217556b3ae44f741b.tar.gz
SMAPI-83aec980b3ee739fb4bc251217556b3ae44f741b.tar.bz2
SMAPI-83aec980b3ee739fb4bc251217556b3ae44f741b.zip
Add UpdateManifest site type.
Adds the UpdateManifest site key and associated client. This required some additional features in the existing update machinery. Each "version" can now (optionally) have its own download URL. Mod Page objects can now specify that subkey matching (for that page) should be "strict". A strict subkey match does not fall back to matching with no subkey if a subkey was provided but produced no versions. It also strips the leading '@' from the subkey. IModDownload objects are now responsible for deciding whether a subkey matches or not. The default behavior is unchanged, but this allows different mod sites to have different rules for subkey matching (which the UpdateManifest mod site uses to force exact matches).
Diffstat (limited to 'src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestVersionModel.cs')
-rw-r--r--src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestVersionModel.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestVersionModel.cs b/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestVersionModel.cs
new file mode 100644
index 00000000..55b6db61
--- /dev/null
+++ b/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestVersionModel.cs
@@ -0,0 +1,26 @@
+// Copyright 2022 Jamie Taylor
+using System;
+namespace StardewModdingAPI.Web.Framework.Clients.UpdateManifest {
+ /// <summary>Data model for a Version in an update manifest.</summary>
+ internal class UpdateManifestVersionModel {
+ /// <summary>The semantic version string.</summary>
+ public string Version { get; }
+
+ /// <summary>The URL for this version's download page (if any).</summary>
+ public string? DownloadPageUrl { get; }
+
+ /// <summary>The URL for this version's direct file download (if any).</summary>
+ public string? DownloadFileUrl { get; }
+
+ /// <summary>Construct an instance.</summary>
+ /// <param name="version">The semantic version string.</param>
+ /// <param name="downloadPageUrl">This version's download page URL (if any).</param>
+ /// <param name="downloadFileUrl">This version's direct file download URL (if any).</param>
+ public UpdateManifestVersionModel(string version, string? downloadPageUrl, string? downloadFileUrl) {
+ this.Version = version;
+ this.DownloadPageUrl = downloadPageUrl;
+ this.DownloadFileUrl = downloadFileUrl;
+ }
+ }
+}
+