diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-06-28 22:30:34 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-06-28 22:30:34 -0400 |
commit | c9fedebaf3231a2d5a00a95ff1ffd3ac5dac4ae2 (patch) | |
tree | dd411378aa9a75854350e3638af3b87fa3b012a6 /src/SMAPI | |
parent | 3f5a5e54041a641e30fc5cc899046953d9763da4 (diff) | |
download | SMAPI-c9fedebaf3231a2d5a00a95ff1ffd3ac5dac4ae2.tar.gz SMAPI-c9fedebaf3231a2d5a00a95ff1ffd3ac5dac4ae2.tar.bz2 SMAPI-c9fedebaf3231a2d5a00a95ff1ffd3ac5dac4ae2.zip |
add support for unofficial version in update checks (#532)
Diffstat (limited to 'src/SMAPI')
-rw-r--r-- | src/SMAPI/Program.cs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index a1180474..d899e512 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -675,12 +675,15 @@ namespace StardewModdingAPI ISemanticVersion localVersion = mod.DataRecord?.GetLocalVersionForUpdateChecks(mod.Manifest.Version) ?? mod.Manifest.Version; ISemanticVersion latestVersion = mod.DataRecord?.GetRemoteVersionForUpdateChecks(result.Main?.Version) ?? result.Main?.Version; ISemanticVersion optionalVersion = mod.DataRecord?.GetRemoteVersionForUpdateChecks(result.Optional?.Version) ?? result.Optional?.Version; + ISemanticVersion unofficialVersion = result.Unofficial?.Version; // show update alerts if (this.IsValidUpdate(localVersion, latestVersion, useBetaChannel: true)) updates.Add(Tuple.Create(mod, latestVersion, result.Main?.Url)); else if (this.IsValidUpdate(localVersion, optionalVersion, useBetaChannel: localVersion.IsPrerelease())) updates.Add(Tuple.Create(mod, optionalVersion, result.Optional?.Url)); + else if (this.IsValidUpdate(localVersion, unofficialVersion, useBetaChannel: mod.Status == ModMetadataStatus.Failed)) + updates.Add(Tuple.Create(mod, unofficialVersion, result.Unofficial?.Url)); } // show update errors |