summaryrefslogtreecommitdiff
path: root/src/SMAPI.Toolkit/Framework/Clients/WebApi
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-10-02 16:40:23 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-10-02 16:40:23 -0400
commitb5c88d87d2cb1739585651e02513fef73dfc0e27 (patch)
treecd8a2afda5ee8cccc806574613f6de4073970c7a /src/SMAPI.Toolkit/Framework/Clients/WebApi
parent0888f71a5c7fe2bbf815409a70834ac85013c7f8 (diff)
downloadSMAPI-b5c88d87d2cb1739585651e02513fef73dfc0e27.tar.gz
SMAPI-b5c88d87d2cb1739585651e02513fef73dfc0e27.tar.bz2
SMAPI-b5c88d87d2cb1739585651e02513fef73dfc0e27.zip
add support for unified mod data overrides on the wiki
Diffstat (limited to 'src/SMAPI.Toolkit/Framework/Clients/WebApi')
-rw-r--r--src/SMAPI.Toolkit/Framework/Clients/WebApi/ModExtendedMetadataModel.cs28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModExtendedMetadataModel.cs b/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModExtendedMetadataModel.cs
index 8c21e4e0..5945ff6e 100644
--- a/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModExtendedMetadataModel.cs
+++ b/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModExtendedMetadataModel.cs
@@ -1,4 +1,3 @@
-using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@@ -87,11 +86,14 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi
/****
** Version mappings
****/
- /// <summary>Maps local versions to a semantic version for update checks.</summary>
- public IDictionary<string, string> MapLocalVersions { get; set; }
+ /// <summary>A serialized change descriptor to apply to the local version during update checks (see <see cref="ChangeDescriptor"/>).</summary>
+ public string ChangeLocalVersions { get; set; }
- /// <summary>Maps remote versions to a semantic version for update checks.</summary>
- public IDictionary<string, string> MapRemoteVersions { get; set; }
+ /// <summary>A serialized change descriptor to apply to the remote version during update checks (see <see cref="ChangeDescriptor"/>).</summary>
+ public string ChangeRemoteVersions { get; set; }
+
+ /// <summary>A serialized change descriptor to apply to the update keys during update checks (see <see cref="ChangeDescriptor"/>).</summary>
+ public string ChangeUpdateKeys { get; set; }
/*********
@@ -137,8 +139,9 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi
this.BetaCompatibilitySummary = wiki.BetaCompatibility?.Summary;
this.BetaBrokeIn = wiki.BetaCompatibility?.BrokeIn;
- this.MapLocalVersions = wiki.MapLocalVersions;
- this.MapRemoteVersions = wiki.MapRemoteVersions;
+ this.ChangeLocalVersions = wiki.Overrides?.ChangeLocalVersions?.ToString();
+ this.ChangeRemoteVersions = wiki.Overrides?.ChangeRemoteVersions?.ToString();
+ this.ChangeUpdateKeys = wiki.Overrides?.ChangeUpdateKeys?.ToString();
}
// internal DB data
@@ -148,16 +151,5 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi
this.Name ??= db.DisplayName;
}
}
-
- /// <summary>Get update keys based on the metadata.</summary>
- public IEnumerable<string> GetUpdateKeys()
- {
- if (this.NexusID.HasValue)
- yield return $"Nexus:{this.NexusID}";
- if (this.ChucklefishID.HasValue)
- yield return $"Chucklefish:{this.ChucklefishID}";
- if (this.GitHubRepo != null)
- yield return $"GitHub:{this.GitHubRepo}";
- }
}
}