From c0370c54113bc95919affcbfbba8720a42b97a30 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 29 Jun 2018 01:50:06 -0400 Subject: add includeExtendedMetadata option to toolkit client (#532) --- .../Framework/Clients/WebApi/ModSeachModel.cs | 4 +++- .../Framework/Clients/WebApi/WebApiClient.cs | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/StardewModdingAPI.Toolkit') diff --git a/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModSeachModel.cs b/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModSeachModel.cs index 754cf02c..df0d8457 100644 --- a/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModSeachModel.cs +++ b/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModSeachModel.cs @@ -31,9 +31,11 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi /// Construct an instance. /// The mods to search. - public ModSearchModel(ModSearchEntryModel[] mods) + /// Whether to include extended metadata for each mod. + public ModSearchModel(ModSearchEntryModel[] mods, bool includeExtendedMetadata) { this.Mods = mods.ToArray(); + this.IncludeExtendedMetadata = includeExtendedMetadata; } } } diff --git a/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/WebApiClient.cs b/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/WebApiClient.cs index 3e412fc3..5bbe473e 100644 --- a/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/WebApiClient.cs +++ b/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/WebApiClient.cs @@ -33,11 +33,12 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi /// Get metadata about a set of mods from the web API. /// The mod keys for which to fetch the latest version. - public IDictionary GetModInfo(params ModSearchEntryModel[] mods) + /// Whether to include extended metadata for each mod. + public IDictionary GetModInfo(ModSearchEntryModel[] mods, bool includeExtendedMetadata = false) { return this.Post( $"v{this.Version}/mods", - new ModSearchModel(mods) + new ModSearchModel(mods, includeExtendedMetadata) ).ToDictionary(p => p.ID); } -- cgit