summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Web')
-rw-r--r--src/SMAPI.Web/Controllers/ModsApiController.cs41
-rw-r--r--src/SMAPI.Web/wwwroot/StardewModdingAPI.metadata.json21
2 files changed, 25 insertions, 37 deletions
diff --git a/src/SMAPI.Web/Controllers/ModsApiController.cs b/src/SMAPI.Web/Controllers/ModsApiController.cs
index b500e19d..18d55665 100644
--- a/src/SMAPI.Web/Controllers/ModsApiController.cs
+++ b/src/SMAPI.Web/Controllers/ModsApiController.cs
@@ -83,31 +83,25 @@ namespace StardewModdingAPI.Web.Controllers
/// <summary>Fetch version metadata for the given mods.</summary>
/// <param name="model">The mod search criteria.</param>
[HttpPost]
- public async Task<object> PostAsync([FromBody] ModSearchModel model)
+ public async Task<IEnumerable<ModEntryModel>> PostAsync([FromBody] ModSearchModel model)
{
- // parse request data
- ISemanticVersion apiVersion = this.GetApiVersion();
- ModSearchEntryModel[] searchMods = this.GetSearchMods(model, apiVersion).ToArray();
+ if (model?.Mods == null)
+ return new ModEntryModel[0];
// fetch wiki data
WikiCompatibilityEntry[] wikiData = await this.GetWikiDataAsync();
-
- // fetch data
IDictionary<string, ModEntryModel> mods = new Dictionary<string, ModEntryModel>(StringComparer.CurrentCultureIgnoreCase);
- foreach (ModSearchEntryModel mod in searchMods)
+ foreach (ModSearchEntryModel mod in model.Mods)
{
if (string.IsNullOrWhiteSpace(mod.ID))
continue;
ModEntryModel result = await this.GetModData(mod, wikiData, model.IncludeExtendedMetadata);
- result.SetBackwardsCompatibility(apiVersion);
mods[mod.ID] = result;
}
- // return in expected structure
- return apiVersion.IsNewerThan("2.6-beta.18")
- ? mods.Values
- : (object)mods;
+ // return data
+ return mods.Values;
}
@@ -231,29 +225,6 @@ namespace StardewModdingAPI.Web.Controllers
return current != null && (other == null || other.IsOlderThan(current));
}
- /// <summary>Get the mods for which the API should return data.</summary>
- /// <param name="model">The search model.</param>
- /// <param name="apiVersion">The requested API version.</param>
- private IEnumerable<ModSearchEntryModel> GetSearchMods(ModSearchModel model, ISemanticVersion apiVersion)
- {
- if (model == null)
- yield break;
-
- // yield standard entries
- if (model.Mods != null)
- {
- foreach (ModSearchEntryModel mod in model.Mods)
- yield return mod;
- }
-
- // yield mod update keys if backwards compatible
- if (model.ModKeys != null && model.ModKeys.Any() && !apiVersion.IsNewerThan("2.6-beta.17"))
- {
- foreach (string updateKey in model.ModKeys.Distinct())
- yield return new ModSearchEntryModel(updateKey, new[] { updateKey });
- }
- }
-
/// <summary>Get mod data from the wiki compatibility list.</summary>
private async Task<WikiCompatibilityEntry[]> GetWikiDataAsync()
{
diff --git a/src/SMAPI.Web/wwwroot/StardewModdingAPI.metadata.json b/src/SMAPI.Web/wwwroot/StardewModdingAPI.metadata.json
index e72efb39..c95abe75 100644
--- a/src/SMAPI.Web/wwwroot/StardewModdingAPI.metadata.json
+++ b/src/SMAPI.Web/wwwroot/StardewModdingAPI.metadata.json
@@ -51,6 +51,23 @@
* mod is no longer compatible.
*/
"ModData": {
+ /*********
+ ** Content packs
+ *********/
+ "Canon-Friendly Dialogue Expansion": {
+ "ID": "gizzymo.canonfriendlyexpansion",
+ "~1.1.1 | Status": "AssumeBroken" // causes a save crash on certain dates
+ },
+
+ "Everytime Submarine": {
+ "ID": "MustafaDemirel.EverytimeSubmarine",
+ "~1.0.0 | Status": "AssumeBroken" // breaks player saves if their beach bridge is fixed
+ },
+
+
+ /*********
+ ** Mods
+ *********/
"AccessChestAnywhere": {
"ID": "AccessChestAnywhere",
"MapLocalVersions": { "1.1-1078": "1.1" },
@@ -822,7 +839,7 @@
},
"Level Extender": {
- "ID": "DevinLematty.LevelExtender",
+ "ID": "DevinLematty.LevelExtender",
"FormerIDs": "Devin Lematty.Level Extender", // changed in 1.3
"Default | UpdateKey": "Nexus:1471"
},
@@ -1046,7 +1063,7 @@
},
"One Click Shed": {
- "ID": "BitwiseJonMods.OneClickShedReloader",
+ "ID": "BitwiseJonMods.OneClickShedReloader",
"Default | UpdateKey": "Nexus:2052"
},