diff options
author | Jamie Taylor <Jamie.Taylor@pobox.com> | 2022-10-01 21:09:39 -0400 |
---|---|---|
committer | Jamie Taylor <Jamie.Taylor@pobox.com> | 2022-10-01 21:30:14 -0400 |
commit | 83aec980b3ee739fb4bc251217556b3ae44f741b (patch) | |
tree | afa8c91eb20cf56ed2cb35563ba3bd2d1e4c8a46 /src/SMAPI.Web/Framework/Clients/GenericModPage.cs | |
parent | 6d4eed56b1d80d02db773b0cd2f372baec6b2d1b (diff) | |
download | SMAPI-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/GenericModPage.cs')
-rw-r--r-- | src/SMAPI.Web/Framework/Clients/GenericModPage.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/SMAPI.Web/Framework/Clients/GenericModPage.cs b/src/SMAPI.Web/Framework/Clients/GenericModPage.cs index 5353c7e1..4c66e1a0 100644 --- a/src/SMAPI.Web/Framework/Clients/GenericModPage.cs +++ b/src/SMAPI.Web/Framework/Clients/GenericModPage.cs @@ -40,6 +40,8 @@ namespace StardewModdingAPI.Web.Framework.Clients [MemberNotNullWhen(true, nameof(IModPage.Name), nameof(IModPage.Url))] public bool IsValid => this.Status == RemoteModStatus.Ok; + /// <summary>Whether to use strict subkey matching or not.</summary> + public bool IsSubkeyStrict { get; set; } = false; /********* ** Public methods @@ -79,5 +81,19 @@ namespace StardewModdingAPI.Web.Framework.Clients return this; } + + /// <summary>Returns the mod page name.</summary> + /// <param name="subkey">ignored</param> + /// <returns>The mod page name.</returns> + public virtual string? GetName(string? subkey) { + return this.Name; + } + + /// <summary>Returns the mod page URL.</summary> + /// <param name="subkey">ignored</param> + /// <returns>The mod page URL.</returns> + public virtual string? GetUrl(string? subkey) { + return this.Url; + } } } |