tweak update alert rules

This commit is contained in:
Jesse Plamondon-Willard 2020-08-15 13:17:42 -04:00
parent d6a830f7e8
commit 497192fab2
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
2 changed files with 6 additions and 2 deletions

View File

@ -10,6 +10,7 @@
## Upcoming release
* For players:
* Removed the experimental `RewriteInParallel` option added in SMAPI 3.6 (it was already disabled by default). Unfortunately this caused intermittent unpredictable errors when enabled.
* Tweaked the rules for showing update alerts (see _for SMAPI developers_ below for details).
* Fixed broken URL in update alerts for unofficial versions.
* Fixed rare error when a mod adds/removes event handlers asynchronously.
@ -19,6 +20,9 @@
* For the web UI:
* Updated the JSON validator/schema for Content Patcher 1.16.
* For SMAPI developers:
* The web API now returns an update alert in two new cases: any newer unofficial update (previously only shown if the mod was incompatible), and a newer prerelease version if the installed non-prerelease version is broken (previously only shown if the installed version was prerelease).
## 3.6.2
Released 02 August 2020 for Stardew Valley 1.4.1 or later.

View File

@ -198,9 +198,9 @@ 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()))
if (this.IsRecommendedUpdate(installedVersion, optional?.Version, useBetaChannel: installedVersion.IsPrerelease() || search.IsBroken))
updates.Add(optional);
if (this.IsRecommendedUpdate(installedVersion, unofficial?.Version, useBetaChannel: search.IsBroken))
if (this.IsRecommendedUpdate(installedVersion, unofficial?.Version, useBetaChannel: true))
updates.Add(unofficial);
if (this.IsRecommendedUpdate(installedVersion, unofficialForBeta?.Version, useBetaChannel: apiVersion.IsPrerelease()))
updates.Add(unofficialForBeta);