summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-06-29 01:50:06 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-06-29 01:50:06 -0400
commitc0370c54113bc95919affcbfbba8720a42b97a30 (patch)
treea30dc327c7017a5b7b64f037dd7d2f4f9edd7f17 /src
parent68287c983c42b1aff66a695fa663d651482f240e (diff)
downloadSMAPI-c0370c54113bc95919affcbfbba8720a42b97a30.tar.gz
SMAPI-c0370c54113bc95919affcbfbba8720a42b97a30.tar.bz2
SMAPI-c0370c54113bc95919affcbfbba8720a42b97a30.zip
add includeExtendedMetadata option to toolkit client (#532)
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI/Program.cs2
-rw-r--r--src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModSeachModel.cs4
-rw-r--r--src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/WebApiClient.cs5
3 files changed, 7 insertions, 4 deletions
diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs
index d899e512..a88db105 100644
--- a/src/SMAPI/Program.cs
+++ b/src/SMAPI/Program.cs
@@ -595,7 +595,7 @@ namespace StardewModdingAPI
ISemanticVersion updateFound = null;
try
{
- ModEntryModel response = client.GetModInfo(new ModSearchEntryModel("Pathoschild.SMAPI", new[] { $"GitHub:{this.Settings.GitHubProjectName}" })).Single().Value;
+ ModEntryModel response = client.GetModInfo(new[] { new ModSearchEntryModel("Pathoschild.SMAPI", new[] { $"GitHub:{this.Settings.GitHubProjectName}" }) }).Single().Value;
ISemanticVersion latestStable = response.Main?.Version;
ISemanticVersion latestBeta = response.Optional?.Version;
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
/// <summary>Construct an instance.</summary>
/// <param name="mods">The mods to search.</param>
- public ModSearchModel(ModSearchEntryModel[] mods)
+ /// <param name="includeExtendedMetadata">Whether to include extended metadata for each mod.</param>
+ 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
/// <summary>Get metadata about a set of mods from the web API.</summary>
/// <param name="mods">The mod keys for which to fetch the latest version.</param>
- public IDictionary<string, ModEntryModel> GetModInfo(params ModSearchEntryModel[] mods)
+ /// <param name="includeExtendedMetadata">Whether to include extended metadata for each mod.</param>
+ public IDictionary<string, ModEntryModel> GetModInfo(ModSearchEntryModel[] mods, bool includeExtendedMetadata = false)
{
return this.Post<ModSearchModel, ModEntryModel[]>(
$"v{this.Version}/mods",
- new ModSearchModel(mods)
+ new ModSearchModel(mods, includeExtendedMetadata)
).ToDictionary(p => p.ID);
}