summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModData/ModDataRecord.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/ModData/ModDataRecord.cs')
-rw-r--r--src/SMAPI/Framework/ModData/ModDataRecord.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/SMAPI/Framework/ModData/ModDataRecord.cs b/src/SMAPI/Framework/ModData/ModDataRecord.cs
index 79a954f7..56275f53 100644
--- a/src/SMAPI/Framework/ModData/ModDataRecord.cs
+++ b/src/SMAPI/Framework/ModData/ModDataRecord.cs
@@ -106,10 +106,10 @@ namespace StardewModdingAPI.Framework.ModData
/// <summary>Get a semantic local version for update checks.</summary>
/// <param name="version">The remote version to normalise.</param>
- public string GetLocalVersionForUpdateChecks(string version)
+ public ISemanticVersion GetLocalVersionForUpdateChecks(ISemanticVersion version)
{
- return this.MapLocalVersions != null && this.MapLocalVersions.TryGetValue(version, out string newVersion)
- ? newVersion
+ return this.MapLocalVersions != null && this.MapLocalVersions.TryGetValue(version.ToString(), out string newVersion)
+ ? new SemanticVersion(newVersion)
: version;
}
@@ -117,6 +117,11 @@ namespace StardewModdingAPI.Framework.ModData
/// <param name="version">The remote version to normalise.</param>
public string GetRemoteVersionForUpdateChecks(string version)
{
+ // normalise version if possible
+ if (SemanticVersion.TryParse(version, out ISemanticVersion parsed))
+ version = parsed.ToString();
+
+ // fetch remote version
return this.MapRemoteVersions != null && this.MapRemoteVersions.TryGetValue(version, out string newVersion)
? newVersion
: version;