From e1d8838587329bd64f3627c4cdc4ac57d187ad7f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 24 Aug 2021 18:29:03 -0400 Subject: fix update checks not recommending prerelease mod versions for SMAPI beta --- src/SMAPI.Web/Controllers/ModsApiController.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/SMAPI.Web/Controllers') 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 errors = new List(); @@ -198,7 +202,7 @@ namespace StardewModdingAPI.Web.Controllers List updates = new List(); 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); -- cgit