summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/SCore.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-09-06 21:41:02 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-09-06 21:41:02 -0400
commitf2cb952dd1b3752bd172161afadf956b195ec73f (patch)
tree6d3471c6ac801d1223ea44e9f535ddcaf1eb77de /src/SMAPI/Framework/SCore.cs
parent47101419f2cf4b3c532fd996840d7301e77e7785 (diff)
downloadSMAPI-f2cb952dd1b3752bd172161afadf956b195ec73f.tar.gz
SMAPI-f2cb952dd1b3752bd172161afadf956b195ec73f.tar.bz2
SMAPI-f2cb952dd1b3752bd172161afadf956b195ec73f.zip
add support for parallel stable/beta unofficial versions (#594)
Diffstat (limited to 'src/SMAPI/Framework/SCore.cs')
-rw-r--r--src/SMAPI/Framework/SCore.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs
index 59ce3be7..00e608c1 100644
--- a/src/SMAPI/Framework/SCore.cs
+++ b/src/SMAPI/Framework/SCore.cs
@@ -609,10 +609,11 @@ namespace StardewModdingAPI.Framework
}
// parse versions
+ bool useBetaInfo = result.HasBetaInfo && Constants.ApiVersion.IsPrerelease();
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;
+ ISemanticVersion unofficialVersion = useBetaInfo ? result.UnofficialForBeta?.Version : result.Unofficial?.Version;
// show update alerts
if (this.IsValidUpdate(localVersion, latestVersion, useBetaChannel: true))
@@ -620,7 +621,7 @@ namespace StardewModdingAPI.Framework
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));
+ updates.Add(Tuple.Create(mod, unofficialVersion, useBetaInfo ? result.UnofficialForBeta?.Url : result.Unofficial?.Url));
}
// show update errors