diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-07-01 12:23:03 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-07-01 12:23:03 -0400 |
commit | 34c43f9f66b33c402947be5e84544e09cb048290 (patch) | |
tree | 17e5c9602e0e921d939617aa724c6599dec389d0 | |
parent | c12777ad53583997dd9e1ee074e8376da827fc84 (diff) | |
download | SMAPI-34c43f9f66b33c402947be5e84544e09cb048290.tar.gz SMAPI-34c43f9f66b33c402947be5e84544e09cb048290.tar.bz2 SMAPI-34c43f9f66b33c402947be5e84544e09cb048290.zip |
add toolkit method for API data (#532)
-rw-r--r-- | src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModExtendedMetadataModel.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModExtendedMetadataModel.cs b/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModExtendedMetadataModel.cs index a716114b..21376b36 100644 --- a/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModExtendedMetadataModel.cs +++ b/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModExtendedMetadataModel.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -73,5 +74,16 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi this.Name = 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}"; + } } } |