summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/release-notes.md4
-rw-r--r--src/SMAPI.Web/Controllers/ModsApiController.cs6
2 files changed, 8 insertions, 2 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 9ad95a43..e71457af 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -12,7 +12,9 @@
* Internal changes to prepare for upcoming releases.
* For the web API:
- * Fixed update checks recommending prerelease versions if the player has a working non-prerelease version.
+ * Fixed update checks...
+ * not recommending prerelease mod versions if the player has a beta SMAPI version;
+ * recommending prerelease versions if the player has a working non-prerelease version.
## 3.12.2
Released 05 August 2021 for Stardew Valley 1.5.4 or later.
diff --git a/src/SMAPI.Web/Controllers/ModsApiController.cs b/src/SMAPI.Web/Controllers/ModsApiController.cs
index 1956bf29..c6e9a713 100644
--- a/src/SMAPI.Web/Controllers/ModsApiController.cs
+++ b/src/SMAPI.Web/Controllers/ModsApiController.cs
@@ -123,6 +123,10 @@ namespace StardewModdingAPI.Web.Controllers
ModOverrideConfig overrides = this.Config.Value.ModOverrides.FirstOrDefault(p => p.ID.Equals(search.ID?.Trim(), StringComparison.OrdinalIgnoreCase));
bool allowNonStandardVersions = overrides?.AllowNonStandardVersions ?? false;
+ // SMAPI versions with a '-beta' tag indicate major changes that may need beta mod versions.
+ // This doesn't apply to normal prerelease versions which have an '-alpha' tag.
+ bool isSmapiBeta = apiVersion.IsPrerelease() && apiVersion.PrereleaseTag.StartsWith("beta");
+
// get latest versions
ModEntryModel result = new ModEntryModel { ID = search.ID };
IList<string> errors = new List<string>();
@@ -198,7 +202,7 @@ namespace StardewModdingAPI.Web.Controllers
List<ModEntryVersionModel> updates = new List<ModEntryVersionModel>();
if (this.IsRecommendedUpdate(installedVersion, main?.Version, useBetaChannel: true))
updates.Add(main);
- if (this.IsRecommendedUpdate(installedVersion, optional?.Version, useBetaChannel: installedVersion.IsPrerelease() || search.IsBroken))
+ if (this.IsRecommendedUpdate(installedVersion, optional?.Version, useBetaChannel: isSmapiBeta || installedVersion.IsPrerelease() || search.IsBroken))
updates.Add(optional);
if (this.IsRecommendedUpdate(installedVersion, unofficial?.Version, useBetaChannel: true))
updates.Add(unofficial);