diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-10-02 17:53:45 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-10-02 17:53:45 -0400 |
commit | 2e9a26c4395d79485f819145882fe51d69b65f4b (patch) | |
tree | 425bafeb2384665c4fda1ce1a4e4106b5d50d500 /src/SMAPI.Toolkit | |
parent | b5c88d87d2cb1739585651e02513fef73dfc0e27 (diff) | |
download | SMAPI-2e9a26c4395d79485f819145882fe51d69b65f4b.tar.gz SMAPI-2e9a26c4395d79485f819145882fe51d69b65f4b.tar.bz2 SMAPI-2e9a26c4395d79485f819145882fe51d69b65f4b.zip |
restore toolkit method used by external tools
Diffstat (limited to 'src/SMAPI.Toolkit')
-rw-r--r-- | src/SMAPI.Toolkit/Framework/Clients/WebApi/ModExtendedMetadataModel.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModExtendedMetadataModel.cs b/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModExtendedMetadataModel.cs index 5945ff6e..5c2ce366 100644 --- a/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModExtendedMetadataModel.cs +++ b/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModExtendedMetadataModel.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -151,5 +152,16 @@ 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}"; + } } } |